I have a fairly simple script that sets fields visible on the condition of another radio button field. It is implemented twice, once on issue Create and a second on View or Edit.
The one script works on issue Create, as designed. The second script runs on View or Edit but the fields are not hidden. I assume the setVisible Method is either not working properly or is getting overridden by some background Jira process.
The code between the two scripts is identical in my implementation. The Behaviour logs show the various logger.info statements reached so the script is triggered and runs. All fields that should be hidden are shown though.
Adding a twist, the broken script actually worked for a few days and then just stopped working. Our IT dept said nothing in our Staging Jira has changed. A boiled down version of the script:
const strType = getFieldById("customfield_11045")
const theValue = strType.getValue().value;
logger.info(theValue);
//Get Multi-Text Fields
const fldMTextFldDoD = getFieldById("customfield_11029");
const fldMTextFldKG = getFieldById("customfield_10414");
const fldMTextAC = getFieldById ("customfield_10091");
if (theValue == "Something"){
logger.info("Into IF, at true");
fldMTextFldKG.setVisible(true);
logger.info("At false");
fldMTextFldOutcome.setVisible(false);
fldMTextFldDoD.setVisible(false);
fldMTextAC.setVisible(false);
logger.info("Done");
}
Thoughts?