jmwe conditional execution on custom checkbox = checked

Jochen Kranzer November 18, 2016

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

2 votes
Answer accepted
Sam Hall
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.
November 19, 2016

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

Channels Intake January 20, 2017

@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