Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Validating all checkboxes checked using JMWE

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.

2 answers

1 accepted

4 votes
Answer accepted
Suprija Sirikonda _Appfire_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Aug 19, 2021

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

Worked like a charm. Thanks a lot! 

Hi @Suprija Sirikonda _Appfire_ , 

Would you happen to know how to do this same thing in Jira Cloud by any chance?

Thanks,

Iana

David Fischer _Appfire_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Oct 17, 2023

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). 

Like # people like this

Thank you @David Fischer _Appfire_ . I was afraid that'd be the case.

Suggest an answer

Log in or Sign up to answer