Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

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


  • 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.



1 answer

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 any if/else structure you need to support it.

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

Kind regards,

Suggest an answer

Log in or Sign up to answer
Site Admin
Community showcase
Published in Jira Software

An update on Jira Software customer feedback – June 2022

Hello Atlassian Community! Feedback from customers like you has helped us shape and improve Jira Software. As Head of Product, Jira Software, I wanted to take this opportunity to share an update on...

152 views 2 5
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you