Automation - are sub-tasks considered child isssues?

Jimmy Yu February 16, 2024

I set up two automations to close the parent issue when the child issues are closed.  One automation closes the parent issue when all child issues are closed.  The second automation closes the parent issue when all the sub-tasks are closed.

Is a sub-task covered by the first automation (child issues)?  I noticed that in a story with sub-tasks, both automations ran.

1 answer

3 votes
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.
February 16, 2024

Hi @Jimmy Yu -- Welcome to the Atlassian Community!

That depends upon how your rules are written...

For a question like this, please post an image of your complete automation rule, images of any relevant actions / conditions / branches, an image of the audit log details showing the rule execution.  Those will provide context for the community to offer ideas.  Thanks!

Until we see those...

Subtasks are part of their parent issue, although in some things (such as some rule actions) they behave like a stand-alone issue.

If your rule is just using the the parent field, it may be possible to do this with one rule.  The challenge may be if you want the behavior to cascade, as the rule may need to trigger itself.  For example:

  • a sub-task moves to Done, and it is the only subtask of a Story
  • a rule detects that, and so is moved to Done, and that Story is the only child of an Epic
  • ...

 

Kind regards,
Bill

Jimmy Yu February 16, 2024

Thanks @Bill Sheboy 

 

Attached are the rules & audit logs.  The parent/child automation completed successfully, but the parent/sub-tasks one had some errors - presumably because the automation triggered, but the parent was already in done state from the prior automation.

Screenshot 2024-02-16 at 3.03.32 PM.pngScreenshot 2024-02-16 at 3.03.08 PM.png

Screenshot 2024-02-16 at 3.07.17 PM.pngScreenshot 2024-02-16 at 3.07.00 PM.png

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.
February 16, 2024

Because you have two different rules, with the same trigger and no conditions on issue type, they are eventually colliding.  Regarding that Resolution error, I recommend checking the workflow for any sets of resolution.

 

Back to your original question: if you want two rules, I recommend adding a condition immediately after the trigger in each rule to check the issue types.  That will limit which issues proceed through the processing.

 

And as I noted earlier, the challenge can be with a cascade of changing to done / closed for multiple issue type levels.  If you want to handle that, the first rule "When all child issues are completed..." will need to enable the "Allow Rule Trigger" option. That is disabled by default to prevent unintended problems.

That option will allow changes made by the subtask rule (to their parent) to trigger the other rule.  Please note well: before doing that, fully test your rules to prevent run-away rule looping errors.

 

Aside: because of the potential risk of manual errors, I recommend having rules to move parents from "not started" to "in progress" when children start work, but not to have rules to move the parents to "done" for the opposite cases.  Then team members can deliberately confirm there is no remaining work before they move a parent issue to "done".

Like Jimmy Yu likes this
Jimmy Yu February 21, 2024

Thanks Bill.  I will look into your suggestions.

Suggest an answer

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

Atlassian Community Events