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

Hi Andreas,

I want to do auto creation of sub-tasks whenever "required" value is selected from drop-down field during issue create/edit ,i have tried the things using filed value change trigger but was not successful.Please find the attached ruleautomation rule testing.PNG

@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
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 Jul 10, 2018 in Marketplace Apps

If you’re an Atlassian app developer, you’ll want to know about Atlas Camp!

This September 6-7, hundreds of Atlassian App developers will flock to Barcelona Spain to build skills, discover product roadmaps, meet face-to-face with the Atlassian team, and learn how to extend t...

180 views 0 4
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