Can I create sub-tasks with Automation for JIRA depending on the value of a select custom field?

Andreas Knecht Community Champion Nov 30, 2016

I have a select custom field (pulldown) and I'd like to create different types of sub-tasks depending on what value is selected.  

If I select the value 2, then I'd like to create 2 types of sub-tasks.  If I select 3, then a couple of different sub-tasks should be created.

Is this possible with Automation for JIRA?

2 answers

1 accepted

1 vote
Andreas Knecht Community Champion Nov 30, 2016

Yes this is definitely something that's possible! You'd have to define 2 rules currently to achieve this.

Here's a screenshot of what one such rule would look like:

create-sub-tasks-when-field-changes.png

Lets break this down:

  • So this rule is triggered whenever an issue is edited
  • Next we have a condition that checks our select custom field was changed (called "Sample Select" here) using the smart-value:

    {{#changelog.Sample Select}}{{toString}}{{/changelog.Sample Select}}
  • Then we check that the new value of "Sample Select" is set to "two" using the smart-value:

    {{issue.fields.Sample Select.value}}
  • Finally we create 2 sub-tasks.

You could then copy this rule, and simply change the second condition to check for a value of "three" and change what sub-tasks get created in the final action.

This is still not quite as simple as we'd like. We're most likely going to introduce a new trigger soon called 'field changed', where you can optionally select if the rule should trigger for 'create, edit or transition'.

 

Andreas Knecht Community Champion Dec 01, 2016

So we just released the new 'Field value changed' trigger and this can now be done even simpler:

Project automation - Code Barrel JIRA 2016-12-02 15-01-35.png

See the release blog for full details: https://blog.codebarrel.io/automatically-update-issues-when-a-jira-issue-field-value-changes-d932f3ea6f0f

@Andreas:Will the links between the children and parent also be created in the new 'trigger to be introduced soon' you mentioned?

 

Andreas Knecht Community Champion Dec 01, 2016

Hey Guhan,

Not 100% sure I fully understand your question - if I've got it wrong, apologies!  But yes with the new trigger you'll still be able to create sub-tasks for an issue that had its field value changed.

We've actually just released the new trigger - check out an example rule on our release blog - perhaps that answers your question better: https://blog.codebarrel.io/automatically-update-issues-when-a-jira-issue-field-value-changes-d932f3ea6f0f

Cheers,
  Andreas

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
Bridget Sauer
Published Thursday in Marketplace Apps

Calling all developers––You're invited to Atlas Camp 2018

 Atlas Camp   is our developer event which will take place in Barcelona, Spain  from the 6th -7th of   September . This is a great opportunity to meet other developers and get n...

356 views 0 6
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