jmwe conditional execution on custom checkbox = checked

I want to execute a post function, if the custom field named "Backlog" (type = checkboxes, ID = 10901, search template = multi select searcher) is checked. The custom field has just one option named "create issue in backlog". Can someone please help me in setting up a correct condition? Thank you very much!

 

Background:
My workflow creates new issues in TODO status by default. Some issues should not get part of the production pipeline immediately - they should be created in status BACKLOG. I want to provide a simple checkbox in my create issue screen, which - when selected - will transition the new issue to status BACKLOG. 

1 answer

1 accepted

Hi Jochen,

Assuming you are using JIRA Cloud and have the JIRA Misc Workflow Extensions (JMWE) add-on installed.

  1. Edit your workflow and find the 'Create' transition. Add a post-function...

    create-add-post-function.jpg

  2. Select "Transition current issue (JMWE add-on)" and click 'Add'...

    add-post-function.jpg
  3. Set it up with Transition = "Backlog", and check the "Run this post-function only if a condition is verified" box.
     
  4. In Condition, put the following script:

    {% if issue.fields["Backlog"] | last | field("value") == "Create issue in backlog" %}
    true
    {%endif%}


    So it should look like:

    jmwe-script.jpg

  5. After you have added this, use the arrows to move it down to number 2 in the list, after "Creates the issue originally":

    move-down.jpg

This should work based on the following assumptions:

  • Your checkbox custom field is called "Backlog".
  • Your checkbox only has one option that can be checked, and it is called "Create issue in backlog".
  • The transition you need to execute to get from TODO to the BACKLOG status is called "Backlog".

Youn might need to tweak the values to match your set up exactly.

Hope this helps.

Sam

Sam Hall Community Champion Nov 19, 2016

For future reference, theres is some info about accessing user created custom fields on the Innovalog Documentation and Support site.

In particular, the bit about accessing checkboxes is here: https://innovalog.atlassian.net/wiki/display/JMWEC/User+created+custom+fields#Usercreatedcustomfields-Checkboxes/Multi-selectlist.

@Sam HallHi! I was just wondering, how would you go about selections for multiple checkboxes? Where the post-transition function will do different things depending on which boxes are checked. 

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Posted 7 hours ago in Jira

We want to know what Jira Service Desk apps you're using!

Hi Community! My name is Amir and I’m on the Jira Service Desk product marketing team at Atlassian. Our team would love to understand how you’re leveraging our ecosystem for Jira Service Desk. Wha...

26 views 0 5
Join discussion

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