Forums

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

Jira Autimation: creating subtask after closed two tasks linked to change

Mohamed Saad Taha
Contributor
August 8, 2023

Dears,

I created automation rule to create two subtask to change and another rule to transit the change once the subtasks is closed.

now I want to change this to create third subtask once the other subtasks closed and to be linked to same change and once the third one is closed to transit the change to next step

how can I do this ?

thanks in advance

 

1 answer

1 accepted

3 votes
Answer accepted
Mark Segall
Community Champion
August 8, 2023

Hi @Mohamed Saad Taha 

This is how I typically configure rules where the parent transitioning is dependent upon all sub-tasks being closed:

  • TRIGGER: Issue Transitioned (To Closed)
  • CONDITION: Issue Type = Sub-Task
  • CONDITION (Related Issues Condition - JQL)
    • Parent = {{issue.Parent}} and status = Closed
    • All Match
  • ACTION: Transition Issue (To YOURSTATUS)
Mohamed Saad Taha
Contributor
August 8, 2023

HI @Mark Segall 

thanks, alot for your reply and I am so sorry I couldn't describe what I need in proper way. 

1- I have Change with two subtasks created by automation 

2- What I need is to create third task once the first two tasks are closed and to be related to 

3- then after the third one is closed the main change is transit to next step (this is easy to achieve only one challenge is when the first two subtasks are closed it may match with parent close condition) 

Mark Segall
Community Champion
August 8, 2023

Ahh ok I understand now.  So you'd need something like this:

RULE 1: Create the first two Sub-Tasks

As you said, you have this one working.  However, these should probably be created with some mechanism to differentiate them from Sub-Task #3 (e.g. a component, label, custom field, etc.)

For example purposes, we'll go with a fictitious component called "Phase 1"

RULE 2: Create the 3rd Sub-Task and/or close the Parent

Since creation of the 3rd sub-task and closing out the parent are based upon the same trigger, we could use the same rule for both actions:

NOTE - For example purposes, Sub-Task #3 will have a component called "Phase 2"

  • TRIGGER: Issue Transitioned (To Closed)
  • CONDITION: Issue Type = Sub-Task
  • IF CONDITION: Component contains Phase 2
    The IF condition validates whether this is Sub-Task #3 and if so, branch into the parent and transition accordingly
    • BRANCH (Parent)
      • ACTION: Transition Issue (To YOURSTATUS)
  • ELSE CONDITION 
    The Else conditions validate that this is Sub-Task #1/#2 and verifies that both sub-tasks are closed.  If yes, then it creates Sub-Task #3
    • CONDITION: Component contains Phase 1
    • CONDITION: Related Issues Condition (JQL)
    • Parent = {{issue.Parent}} and status = Closed and component IN ("Phase 1")
    • All Match
    • ACTION: Create Sub-Task
      • Set Component to Phase 2

Again, this is using component as a mechanism to delineate the types of sub-tasks so feel free to tweak as necessary.

Mohamed Saad Taha
Contributor
August 10, 2023

Thanks a lot for your answer and interest I made it with few changes as below, but I am not able to make task#3 Linked to main change request :( when I fill the linked issues from parent it takes the subtask not the main change.

can you please support in this?

linked.JPG 

Like Shaun Rucker likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events