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

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,558,800
Community Members
 
Community Events
184
Community Groups

How do I retreive the valuees checked in a multi-value checkbox?

Hello, I have a checkbox called "Risk Assessment" with two possible values, "Security Risk" and "Licenses Risk". I require both values to be checked before a workflow can transition to the next (final) state. How can I do this? I have successfully used the Power apps and SIL code for validators before, and for this I tried:

string[] checkbox = gadget_getMultiValues(argv, "Risks Assessed");

if( arrayElementExists(checkbox,"Security Risk") && arrayElementExists(checkbox,"Licenses Risk") ) {
return true; }
else {
return false, errMsg; }

but it's not working. I've examined the checkbox array and it always seems empty, and the argv array, which has numbers in it? Has anyone got gadget_getMultiValues to work for checkboxes, or know of a way that works?

1 answer

Hello @Chris Shaw ,

Do you still need help with it? 

There are a few things that are not clear to me. Is your checkbox a Jira native checkbox field? Also, I assume this checkbox custom field is located on the transition screen, and you need a validator to check that all those values in the checkbox are selected. Is that correct? 
I am unsure if my understanding is correct because you mentioned gadget_getMultiValues which is the SIL Runner Gadget routine, and I cannot understand how to connect the gadget to this scenario. So please correct me if my understanding of the general picture and use case is wrong. 

But meanwhile, I`ll provide you with a validator example that matches the scenario per my understanding. 

string errorMsg = "The field Risks Assessed must have all values checked!";
string val = getInput("Risks Assessed");

if(contains(val, "Security Risk|Licenses Risk")) {
return true;
}else {
return false, errorMsg; }

This will allow you to transit only if you have those two checkboxes Security Risk and Licenses Risk checked. But if your checkbox may have some other 3d, 4th, etc options and you want to allow as many checkboxes as the user selects but Security Risk and Licenses Risk are obligatory, you need to use the following instead of line 3

if(contains(val, "Security Risk") and contains(val, "Licenses Risk") ) {

 If this doesn`t match your needs, please answer my above questions and I will try to help you. 

Best regards,
Anna

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
8.20.11
TAGS
AUG Leaders

Atlassian Community Events