Automation for subtasks/parents JQL -- Need help coming up with the query

abby.kaske June 8, 2022

Background:

  • We use a custom field called Environment with the options of Dev Branch, Stage, Demo, and Prod.
  • Some teams use subtasks, some do not.
  • Subtasks can go through the environments at different times (one could be in Dev Branch, one in Stage, one in Demo, etc)
  • It's possible to only have 1 subtask

 

Our QA team needs to know when the parent task is in Demo, which is tricky because part of it might already be in production by the time the last subtask gets to Demo. So I need to be able to update the parent IF

  • All subtasks Environment = Demo 
  • One subtasks Environment = Demo and the other subtasks Environment in(Demo,Prod)

 

I have the following rule set up in automation:

Action: When value changes for Environment

If: Environment = Demo

For Parent

  • IF subtasks Match: "Environment[Dropdown]" = Demo or "Environment[Dropdown]" in(Demo, Production)
  • Then edit field Environment to Demo

 

I think this might work, but I am worried about things where there is only 1 subtask, and if it moves to Production, would it then update the parent to Demo? We have separate automation that updates the parent Environment to Production if all subtasks are in Production, but you can't force order of execution of rules, so I'm worried it'll move Environment back to Demo even though it should be Production.

 

Thoughts?

1 answer

1 vote
Bill Sheboy
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.
June 8, 2022

Hi @abby.kaske 

For your special case of one-and-only-one subtask, you could use the Lookup Issues action to gather up all subtasks/siblings of the trigger issue with JQL, and then check if there is only one with an advanced compare condition...plus any if/else structure you need to support it.

  • first value: {{lookupIssues.size|0}}
  • condition: equals
  • second value: 1

Kind regards,
Bill

Suggest an answer

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

Atlassian Community Events