Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Create subtasks in order, not at the same time.

Caroline_Courchesne April 11, 2018

Hello,

I'm using a template (with Issue templates) which contains 7 subtasks created at the same time but I'm looking for a way to create the subtasks in order. When the first subtask is Resolved, it creates the second one and so on for the others. 

We have Script Runner but I'm still a beginner so any suggestions? :)

Thanks!

1 answer

0 votes
Nic Brough -Adaptavist-
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.
April 11, 2018

You've probably already thought of this.

To chain the subtasks, you will need to use your own scripts, but they're not too painful.  At the moment, you've got a template (not sure how you're doing that, but it's not too important) that creates 7 sub-tasks.  Change it so that it only creates the first one you want.

You will need to create something that can track which sub-task you are in.  One option would be to make sure each of your 7 sub-tasks is of a different type, but you could also do it with a simple number custom field (you don't even need to put it on the view screen if it's not important to users).  I suggest numbers because I've done this and "add one to number" is easy in the script.

Then, write a post-function for the sub-tasks "resolve" transition.  This should:

  • Look at the current sub-tasks place in the chain (issue type or the custom field)
  • Look at the parent, as we'll need that for creating the next task
  • Issue a creation call, setting the new sub-task's type appropriately

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events