Can I create sub-tasks when a specific transition occurs using Automation for JIRA Cloud?

Sam Hall Community Champion Nov 30, 2016

I want to create a set of sub-tasks when a particular transition occurs.

For example, when an issue moves from To Do status to In Progress status, I want to automatically create a couple of sub-tasks.

I only want this to happen once, though - just the first time the issue is transitioned.

I think this is possible with Automation for JIRA (Cloud version), but what is the best way to implement?

Thanks

3 answers

1 accepted

1 votes

Hi Sam,

I'm one of the creators of Automation for JIRA and you can certainly do this.  Here's what the rule needs to look like:

conditionally-create-subtasks.png

Lets break this down:

  • Whenever an issue is transitioned
  • We use a compare two values condition to check if the status has changed from a particular old value to a new value using this smart-value: 

    {{#changelog.status}}{{fromString}} > {{toString}}{{/changelog.status}}
  • Next we use the "Related issues" condition to check if any sub-tasks are present yet (you could also use JQL here to check for specific sub-tasks)
  • Finally we create 2 new sub-tasks with the "Create sub-tasks" action.

Detecting the status change is a bit complicated still, but we'll ship a new trigger in the next couple of days, that will make this even easier!  It will allow you to run a rule whenever any issue field value changes (including status).

 

Just to let you know - the new trigger I talked about in my answer above is now available in production as well. You can see an example here: https://blog.codebarrel.io/automatically-update-issues-when-a-jira-issue-field-value-changes-d932f3ea6f0f

Makes it a bit easier to trigger a rule when the status changes!

Hi Sam,

Disclaimer I work on ScriptRunner for JIRA Cloud.

This is exactly the kind of use case ScriptRunner for JIRA Cloud is designed for. You could use a Create Subtask Post Function (http://scriptrunner-docs.connect.adaptavist.com/jiracloud/post-functions.html#_create_subtask) with a condition on the number of subtasks the issue has.

Regards, Jon

Sam Hall Community Champion Dec 01, 2016

Thanks Jon. I'll give it a try and see how it works.

Sam, There is an add on for multi sub task creation in market place. Once installed, you can see that as part of your post function for your transitions while editing your workflow. Edit the transition for 'To Do', click on Post Functions tab, use the multi sub task utility to define your sub task attributes, publish the updated workflow. Now when you move the issue from To Do status to In Progress, your sub tasks will be automatically be created. You can see them in your issue detail screen. Good luck.

Sam Hall Community Champion Dec 01, 2016

Thanks Guhan. What's the add on called?

Sam, I used JIRA Suite Utilities (JSU) long time back. I could see that it is not supported by Atlassian anymore, but the functionalities are there in Bobs Issues on Transition related add on too. Market place may have the latest ones and hope you can find one suitable for your environment.

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

2,958 views 12 18
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot