Jira Automation For Parent SubTasks Summary JQL

Samuel_Stinton April 8, 2024

Screenshot 2024-04-08 163027.png

I want to use Automation to set the status of a Task based on it's Sub-Tasks, I;ve got several sets of Subtasks all with a different prefix.

In the above while the "status != Done" is working and checks the Subtasks, The issue.summary is returning the contents of the Parent, what am I missing to pull the Subtask summary instead?

3 answers

1 accepted

3 votes
Answer accepted
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.
April 8, 2024

Hi @Samuel_Stinton -- Welcome to the Atlassian Community!

I do not believe you can use a JQL condition for your test.  The expression must be valid JQL, and you are performing a specific comparison for the first condition: comparing a substring of the summary to a defined string.

A work-around for this would be to use a smart value condition, an iterator over the subtasks, with conditional logic,  and a math expression.  For example:

  • first value:
{{#=}}0{{#issue.subtasks}}{{#if(and(equals(summary.left(3),"IT&"),not(equals(status.name,"Done"))))}}+1{{/}}{{/}}{{/}}
  • condition: greater than
  • second value: 0

 

How that expression works is:

  1. iterating over the subtasks in that parent issue
  2. use conditional logic to check the summary and status
  3. and when they match, add to the count
  4. wrapping all of that in a math expression, with a default value of 0 at the front.

 

Kind regards,
Bill

Samuel_Stinton April 9, 2024

This is perfect, took me a while to get it filtered down properly and ended up transitioning from status X to Y once all subtasks for X were completed.

Thank you so much Bill!

Like Bill Sheboy likes this
2 votes
Valerie Knapp
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 8, 2024

Hi @Samuel_Stinton , welcome to the Atlassian Community and thanks for your question.

Have you tried adjusting the branch for it to be, instead of For: Parent, to be for: Subtasks?

Please test this and share your results.

Cheers

Samuel_Stinton April 8, 2024

Had a look with the hope of updating the Parent task on subtask closure and using that to trigger the Subtasks, but while this run successfully it doesn't match any subtasks to the IF and parent does not transition

Screenshot 2024-04-08 205425.png

2 votes
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 8, 2024

Hi Samuel - Welcome to the Atlassian Community!

Use {{triggerIssue.summary instead of issue.summary

Samuel_Stinton April 8, 2024

Unfortunately I'm triggering from a Subtask on Transition, so the Triggerissue wouldn't check the other subtasks

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