Hi, I'm writting a script validator against a cascade select list and am getting this error
"Cannot find matching method java.lang.Object#keySet()"
here is my script: cfValues["Service - Category"]?.keySet()?.size() == 2
where Service - Category is the name of my cascade select list. I followed the instructions as written in https://scriptrunner.adaptavist.com/5.2.1/jira/recipes/workflow/validators/simple-scripted-validators.html.
Looks like someone also experienced the same error here: https://community.atlassian.com/t5/Jira-questions/How-can-I-make-both-fields-in-a-Cascading-Select-required/qaq-p/26045.
Any ideas as to whats wrong?
So the cfValues["Service - Category"] will work only for a Simple scripted validator.
The cfValues["Service - Category"]?.keySet()?.size() == 2 is correct and it will return true if there are exactly two options selected for your cascading select list (parent and child).
If you describe me what you want to achieve then I believe I can help further.
By the way the error you get in the UI is because of the static type checking and some time is safe to ignore it (jira logs will tell you the truth).
Hi all! My name is Miles and I work on the Marketplace team. We’re looking for better ways to recommend and suggest apps that are truly crowd favorites, so of course we wanted to poll the Community. ...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG