Automating creation of Sub-tasks on completion of multiple existing Sub-tasks

Marcus Burnett May 22, 2024

Hi,

 

My current workflow is like the below:

When creating an Issue (in this instance Issue Type is 'Test Issue') for a Project, I have an automation currently configured to automate the creation of two sub-tasks within that Issue (in this instance named 'Subtask1' & 'Subtask2')

 

However, I also want a second automation configured. This automation should create 'Subtask3' & 'Subtask4' once BOTH 'Subtask1' & 'Subtask2' have been completed (in our instance this Status has been set as 'Closed'. 

 

I have been successful in creating a Subtask when a single Subtask has been Closed, using the below automation;

Single Subtask Creation.jpg

 

However, I can't figure out how to configure the automation when it comes to closing multiple Subtasks in order to trigger the 2nd automation to create the next Subtasks.

I attempted to follow https://community.atlassian.com/t5/Jira-questions/How-to-automatically-create-a-sub-task-when-other-two-sub-tasks/qaq-p/2343674  but didn't appear to have the same options to select from, that had been suggested in the comments. So, I ended up with the below automation (which isn't running at the point that I close 'Subtask1' & 'Subtask2');

Failed automation for closing multiple Subtasks.jpg

 

I presume I've misunderstood a step, or have entered something incorrectly, but just can't get the automation to work. Any help would be great! Thanks 

1 answer

1 accepted

0 votes
Answer accepted
Kalyan Sattaluri
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.
May 22, 2024

Hello @Marcus Burnett 

Can you explain your requirement in more detail. Is it like below?

  • If you have 1 existing sub-task, which when closed, you want to create a second sub-task.
  • When the 2nd subtask is also closed, (so all are closed), you want to create a third one?

What happens if the third is also closed, you want to create fourth or stop with 3?

I dont think you need a different rule, all of this can be handled in 1 rule. so Please clarify your ask.

Marcus Burnett May 22, 2024

Hi @Kalyan Sattaluri 

Thanks for your reply.

No that is not quite what I need.

The first 2 subtasks need to be created together, when the Issue is initially opened.

I need the 3rd & 4th subtasks to be created once BOTH the 1st and 2nd subtasks have been closed. If only 1 of the first 2 subtasks is closed, then the automation shouldn't run until the 2nd subtask has been closed as well. These subtasks will likely be closed at different times, so I need to wait until both have been closed before the 3rd & 4th subtasks can be created. 

I may need to create other subtasks after the 3rd & 4th subtasks have been closed, but at the moment my main concern is getting the above automation to work.

I hope that makes sense!

Kalyan Sattaluri
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.
May 22, 2024

Assuming that the creation of the first 2 sub-tasks at the point of issue creation is good/ you have implemented,

You can create the subsequent third/fourth based on your requirement like below:

  • Your trigger will check "Issue Transitioned" to Done.
  • if so, you check if the trigger issue a sub task
  • if so, you check if count of sub-tasks is 2
  • if so, you check if all are in Done state.
  • if all conditions match, you can create your next subtasks.

The syntax to check if all subtasks are done is:

  • {{#issue.parent.subtasks}}{{#if(not(equals(status.name,"Closed")))}}true{{/}}{{/}}     
  • DOES NOT CONTAIN 
  • true

*NOTE - The bolded part in above needs to be changed to your final/terminal state of Sub-tasks and it has to match exactly. That is, closed != Closed. So please confirm that.

 

image.png

 

Please implement above, try it and share if issues. Thanks!

Marcus Burnett May 22, 2024

Hi @Kalyan Sattaluri 

I think this has worked! On closing the first 2 subtasks, a 3rd subtask has been created.

I need to do some further testing that this works for the Project I'm configuring, as there are a number of other similar automations required for different Issue Types and Subtasks, but I think this should be what I need.

Thanks a lot for your help!

Kalyan Sattaluri
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.
May 22, 2024

Glad to hear. Yes, please test. I created only 1 sub-task in my screenshot. You can add 1 more. And then test closing the third subtask and verify this rule does not create any more etc... Do let me know if any clarifications..

Also, Please consider accepting solution so it benefits others in the future. Thanks!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events