Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Hide/Show field behaviour: What am I doing wrong?

Carl Rushing May 17, 2022

I want to hide a field when anything but "Yes" is selected in the radio button field preceding it.


def selectRadioField = getFieldById("customfield_13802")
def selectRadioValue = selectRadioField.value
def listField = getFieldById("customfield_11015")

if (selectRadioValue == "Yes") {
listField.setHidden(false)
listField.setRequired(true)
} else {
listField.setHidden(true)
listField.setRequired(false)
}

I am defaulting to "No" in the radio options and the listField is initially hidden. If I select "Yes" nothing happens. If I change the listField to shown, it still shows when "No" is selected by default and switching from "No" to "Yes" then back to "No" does nothing.

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events