Hi!
I have a checkbox field with 7 options. I would like to create a validator that only allows the transition to happen if all of the options are checked. Any ideas on how I can do this?
Thanks in advance.
Hi @Iana ,
Add a Scripted (Groovy) Validator (JMWE app) and add the below Groovy script:
!issue.getAvailableOptions("customfield_10300") || (!!issue.get("customfield_10300") && issue.get("customfield_10300").size() == issue.getAvailableOptions("customfield_10300").size())
Replace 10300 with the id of the checkbox field.
The validator uses getAvailableOptions method to get the available options for the specified field and it returns true only if all the options are selected in the checkbox field. Else, it returns false if the field is empty or if all options are not selected.
Hope this helps!
Regards,
Suprija
Hi @Suprija Sirikonda _Appfire_ ,
Would you happen to know how to do this same thing in Jira Cloud by any chance?
Thanks,
Iana
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Iana
You can't do exactly the same thing on Jira Cloud, because you cannot access the list of available options from Jira Expressions. So you'll need to hardcode in the validator code the number of options:
!!issue.customfield_10200 && issue.customfield_10200.length == 7
where customfield_10200 is the field ID of your checkboxes custom field and 7 the number of options (checkboxes).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.