I need assistance with a Scriptrunner behavior to hide/show a field based on value of checkbox field.
"Origin of Defect" (checkbox field)
"Origin of Defect: Other" (single line of text field)
My checkbox field "Origin of Defect" contains numerous values including "Other". I want to show and require the "Origin of Defect: Other" field if the "Origin of Defect" field CONTAINS the selection "Other" (ID 12828 in my case). This works perfectly if ONLY "Other" is selected, however if multiple checkboxes are selected it does not work.
How can I update to accept multiple selections and still get desired behavior ?
def od= getFieldByName("Origin of Defect")
def odO = getFieldByName("Origin of Defect: Other")
odO.setHidden(true)
def odValue = od.getFormValue();
if (odValue =="12828") // Other
{
odO.setHidden(false)
odO.setRequired(true)
}
else
{
odO.setHidden(true)
odO.setRequired(false)
}