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