//If Requested By DevTeam = Art/Exterior Art then don't hide and make requireddef cascadecustomField = getFieldByName("Requested By DevTeam")def selectedOptions = cascadecustomField.getValue() as Mapdef ParentOption = selectedOptions.get(0).toString()def ChildOption = selectedOptions.get(0).toString()// field we want hidden unless ARt/Exterior Art is selected def hiddenField = getFieldByName("Zone")if(ParentOption == "Art" && ChildOption == "Exterior Art"){hiddenField.setHidden(false)hiddenField.setRequired(true)}elsehiddenField.setHidden(true)hiddenField.setRequired(false)
Hi @Shelli Kleman
After going through your description, I suspect you are encountering the Bug SRJIRA-6113, where the Child value of the Cascading Select List cannot be obtained.
A fix for this Bug has already been added but is currently awaiting release, possibly in the next ScriptRunner version.
Another point to note, in your code, you seem to be using the approach below to initialise the Cascading Select List field.
def cascadecustomField = getFieldByName("Requested By DevTeam")
If you require the Behaviour to trigger based on the if/else condition that you have added, it would be best to use a Server-Side Behaviour, and you should initialise the cascading field like:-
def cascadecustomField = getFieldById(fieldChanged)
This ensures that the Behaviour will trigger when the change is made to the Cascading Select List field.
I hope this helps to solve your question.
Thank you and Kind regards,Ram
Thank you so much for letting me know about this bug. Looking forward to seeing that fix in an upcoming release.
It looks like you're new here. Sign in or register to get started.