Hi
I have a Yes/No select box that on Yes I want to show 3 fields and on No I want to hide the fields.
scriptrunner: 4.1.3.29
Jira server: 6.4.10
With the script below when I display my ticket the helper text is displayed as expected (the current value in the field is Yes). However when I change the value to No the helper text is removed but not displayed the fields don't change.
Any help would be appreciated.
Thanks,
Neil
=== script ===
log.warn("setting conditionField");
def EARequiredfield = getFieldById("customfield_14819");
def EARequirements = getFieldById("customfield_14821");
def EAStatus = getFieldById("customfield_14822");
def EAComments = getFieldById("customfield_14823");
def EARequired = EARequiredfield.getValue();
if (EARequired == "No"){
EARequiredfield.setHelpText("test: " + EARequired );
}
else {
EARequiredfield.setHelpText("test 1: " + EARequired );
}
EARequired.each { selectVal ->
if (selectVal == "No"){
EARequirements.setHidden(false);
EAStatus.setHidden(false);
EAComments.setHidden(false);
log.warn("source value: " + EARequirements.isHidden());
}
else {
EARequirements.setHidden(true);
EAStatus.setHidden(true);
EAComments.setHidden(true);
}
}