Workflow Transition: Validator for multicheckbox

Dennis S_ August 29, 2018

Hi everybody,

 

I have a multicheckbox custom field with two possible options. In a certain workflow transition I want to check with a validator, whether both options of the multicheckbox are checked. Otherwise, the transition should not be feasible and an error message schould be shown.

I´ve already tried to fix the problem with the "Fields required (JSU) - validator", but there is no possibility to handle multicheckboxes regarding the values. Perhaps it is possible via the groovy script runner, but unfortunately my groovy skills aren´t good enough. 

 

Can somebody give me a code example to create such a validator or has someone an alternative solution?

 

Thank you in advance for your support.

 

Best regards

Dennis

1 answer

1 accepted

3 votes
Answer accepted
Mark Markov
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.
August 29, 2018

Hello @Dennis S_

You can use simple scripted validator on this transition with condition like this

cfValues['My Multi Checkbox']*.value.contains("value1") && cfValues['My Multi Checkbox']*.value.contains("value2")

this will check if checkbox field have value1 and value2/

Dennis S_ August 29, 2018

It works perfectly! Thanks for your support, Mark.

Manu... November 25, 2019

Is there a way to handle it using CURL 

Harold Wong September 8, 2020

Sorry to necro this thread

you can also use containsAll instead of a bunch of &&

cfValues['My Multi Checkbox']*.value.containsAll("Reminder Value1","Value2") 

much cleaner

susann.ivarsson@dahl.se January 4, 2021

Hi,

I have almost the same question and hope you can help me out. I have a multicheckbox custom field with twelve different options. The checkbox is used for a checklist for decomission a server and before the technician close the Jira issue all the options needs to be handled and marked. 

I have tryid to add a simple scripted validator on the transition "Closed" with condition like this

cfValues['Server decomission checklist']*.value.containsAll("Identify and schedule servers for decomissioning","Locate all software licenses for servers(s)", "Cancel all maintenance and software contracts for server(s)", "etc", "etc") but it's not working.

Do I miss something? Is it the string value in the options I'll validate against or is it something else?  

 

Johannes Rudolf June 22, 2021

I was wondering how it would work vice versa? To allow only one checkbox (out of two)? I have tried and dug around but could not solve it. I'm sure it's easy but I'd appreciate a hint. Thanks! :-)

Lee-Or Efrati April 25, 2022

@Mark Markov , @Harold Wong Is there anything like that for Jira cloud?

Suggest an answer

Log in or Sign up to answer