Forums

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

Automation to move parent (story) to match furthest back subtask status.

Will Kniffin August 9, 2023

Hi all!

I'm trying to write a rule (or set of rules) to transition the parent of multiple subtasks to match the subtask in the furthest left status.

Example: there are 3 subtasks, two are in status C and one is in status A. User transitions the status A subtask from status A to B. The parent of those subtasks should be automatically transitioned from status A to B as well. 

Essentially, the status of the parent should always match the subtask with the least amount of progress (least progress on the workflow).

Thanks so much for any ideas on how to accomplish this!

1 answer

1 accepted

0 votes
Answer accepted
Mark Segall
Community Champion
August 9, 2023

Hi @Will Kniffin and welcome to the community!

You should be able to do something like this with If/Else conditions.  For the below example, I'm using a simple workflow of Open, In Progress, and Closed:

  • TRIGGER: Issue Transitioned
  • CONDITION: Issue Type = Sub-Task
  • IF (Related Issues Condition)
    • JQL Issues
    • parent = {{issue.parent}} AND status = Open and status NOT IN ("In Progress", Closed)
    • Some match specified JQL
    • BRANCH (Parent)
      • CONDITION: Status Not Equal Open 
      • ACTION: Transition Issue To Open
  • Else (Related Issues Condition)
    • JQL Issues
    • parent = {{issue.parent}} AND status = "In Progress" and status NOT IN (Open, Closed)
    • Some match specified JQL
    • BRANCH (Parent)
      • CONDITION: Status Not Equal In Progress 
      • ACTION: Transition Issue To In Progress
  • Else (Related Issues Condition)
    • JQL Issues
    • parent = {{issue.parent}} AND status = Closed and status NOT IN (Open, "In Progress")
    • Some match specified JQL
    • BRANCH (Parent)
      • CONDITION: Status Not Equal Closed 
      • ACTION: Transition Issue To Closed
Will Kniffin August 10, 2023

Thank you Mark! I modified slightly to get all subtasks (there are only ever 3 max) related to the parent in the JQL issues query, then used All match specified JQL rather than Some to check that all the other subtasks are either past or matching the status the issue was just transitioned to.

Like Mark Segall likes this
Leon Lin August 15, 2023

@Mark Segall 

How are you able to do this part of your process:

Screenshot 2023-08-16 at 02.38.32.png

Because when I try to do it, I am not sure how to do the above part. Please see my screenshot below:

Screenshot 2023-08-16 at 02.39.09.png

Thanks!!

Mark Segall
Community Champion
August 15, 2023

In the related issues dropdown, change it to Parent.  Once you've created the branch component, you would nest the condition and action components within the branch.

Leon Lin August 15, 2023

@Mark Segall  But from the screen above, I need to include some matching JQL code, what do I fill in there? Thanks.

Mark Segall
Community Champion
August 15, 2023

You won't need JQL if you change the Related Issues dropdown to Parent

Leon Lin August 15, 2023

@Mark Segall 

Thanks for your comments. I am not sure if my below flow is correct. Mind taking a look at it? Thanks.

 

Screenshot 2023-08-16 at 06.54.43.png

Mark Segall
Community Champion
August 15, 2023

Thanks for sharing the rule.  So the issue is that you have a single branch and then a bunch of serial components/actions.  The problem with this is that it will not process all conditions.  After it fails the first condition, it'll exit.  

To remedy this, you need to go with If/Else conditions which allow you to nest a branch component.  From my 9 August message, it would look something like this:

2023-08-15_17-13-22.png

Leon Lin August 15, 2023

@Mark Segall 

Thank you that helps a lot. Thanks again for you help.

Like Mark Segall likes this
Will Kniffin August 16, 2023

Hi Leon!

In case you need another working example - here is what I went with which is working well:

Screen Shot 2023-08-16 at 9.43.02 AM.png

 

this is just a snippet as it goes on through all of the statuses I have for my tickets.

Hopefully that helps you!

Like # people like this

Suggest an answer

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

Atlassian Community Events