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

andreas
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 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

2 votes
Answer accepted
andreas
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 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
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.
December 1, 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

Barath Bandaru April 26, 2018

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

Murugan Mittapalli
Contributor
November 11, 2019

Hi Barath, 

I am also facing the same issue, did you get the solution for this issue.

 

Thank you.

0 votes
Deleted user December 1, 2016

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

 

andreas
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.
December 1, 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
TAGS
AUG Leaders

Atlassian Community Events