//If Requested By DevTeam = Art/Exterior Art then don't hide and make required
def cascadecustomField = getFieldByName("Requested By DevTeam")
def selectedOptions = cascadecustomField.getValue() as Map
def 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)
}
else
hiddenField.setHidden(true)
hiddenField.setRequired(false)
Hi @SKAdmin
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
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.