Based on CheckBox validation, need to run post function (Run a Transition)

I have a Custom field which is of type CheckBox.

What i want is, if all options of that checkbox custom field are selected, then only that post function should run.


Could some one please help me 

1 answer

What should the post function exactly do?

I personally would use Scriptrunner add-on. It has many build in post functions: See:

Post Function will run a hidden transition based on condition being true. 


Condition is checkbox field shall have all the options ticked.

So need to create a groovy expression for checking that all options are ticked in the custom field 




def customFieldManager = ComponentAccessor.getCustomFieldManager()
def customFields = customFieldManager.getCustomFieldObjects(issue)
customFields.each {cf ->
if ( == '<CUSTOMFIELDNAME>' ) {
return true;
} else {
return false;


*It is not working* 



Have you tried Alexeys corrected code snippet?

def customFieldManager = componentManager.getCustomFieldManager()
def customFields = customFieldManager.getCustomFieldObjects(issue)
def values = []
customFields.each {cf -&gt;
   if (cf.getName() =~ "Check_" &amp;&amp; cf.getCustomFieldType().getName() == "Multi Checkboxes") {
     values += cf.getValue(issue)*.toString()
def validChecks = ['CFO', 'CTO'] //add all your required options here
return values.containsAll(validChecks) ? true : false

It gives an error that 

Spread Operator can be used only on Collection type



Hmm, how many options do you have?

You could check on each:

cfValues['&lt;Your Field&gt;']*.value in ['Option1', 'Option2', ...]

or maybe

cfValues['&lt;Your Field&gt;']*.value.contains("Option1") &amp;&amp;
cfValues['&lt;Your Field&gt;']*.value.contains("Option2") &amp;&amp;

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Thursday in Jira

5 ways you can make the most of Jira Software and Bitbucket Cloud

As part of the Bitbucket product team I'm always interested in better understanding what kind of impact the use of our tools have on the way you work. In a recent study we conducted of software devel...

64 views 0 5
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you