Forums

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

Create and test Jira automation rule for closing tasks

Sierra Lindamood
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 16, 2025

I want to make it so that once all 8 linked tasks are closed, then for the primary linked ticket: The assignee is set back to the reported. The status is set to closed. It automatically adds a comment to the original ticket

These are automation rules that I tried to accomplish this, I know I'm off track here. Any commentary is appreciated. 

(Other issue types are the primary ticket, any linked item is a task issue type)

Screenshot 2025-09-16 120253.pngScreenshot 2025-09-16 120322.png

2 answers

0 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.
September 16, 2025

Hi @Sierra Lindamood -- Welcome to the Atlassian Community!

Would you please clarify your scenario?  Is it one of these:

  1. GIVEN a work item which has 8 other Tasks linked to it, WHEN all 8 Tasks are closed, THEN...
  2. GIVEN a work item with a linked Task, AND that linked Task has other linked Tasks in a chain of 8 work items, WHEN all Tasks in the chain are closed, THEN...
  3. something else

The first one can be solved using the Related Issues Condition, although I find that one a bit unpredictable in results / behavior.  Instead, try using the Lookup Work Items action with a JQL expression to find the linked Tasks for better control over the logic.

The second one cannot be easily solved with automation rules due to how branches work, although it is possible when there is a specific known number of linked work items.

 

Kind regards,
Bill

Sierra Lindamood
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 16, 2025

Hi @Bill Sheboy 

It's 1.) GIVEN a work item, which has 8 other Tasks linked to it, and WHEN all 8 Tasks are closed THEN I need that work item to be auto closed, assignee set back to reporter, add my custom comment. 

Would my Lookup Work Items action with the JQL expression need to essentially say Any Issue Type that has Task Type Linked Items and ALL Linked Items are closed...THEN....

Sierra Lindamood
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 16, 2025

Screenshot 2025-09-16 134400.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.
September 16, 2025

Hi @Sierra Lindamood -- No, you could use the JQL needed to select only your specific ones.  For example:

  • action: lookup work items, with JQL of
project = yourProject
AND issue IN linkedIssues("{{triggerIssue.key}}")
AND issueType = Task
AND statusCategory != Done
  • smart values condition
    • first value: {{lookupIssues.size|0}}
    • condition: equals
    • second value: 0
  • ...continue to update the trigger work item

 

Please note the JQL inverts the condition to check for any not completed ones, and then tests that the count found is 0.

 

Like Sierra Lindamood likes this
Sierra Lindamood
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 16, 2025

Screenshot 2025-09-16 140115.pngIs it to be expected that the JQL cannot be validated? When I put this jql in a regular search this part below, gives me this message: 

JQL error Issue '{{triggerIssue.key}}' could not be found in function 'linkedIssues'.
("{{triggerIssue.key}}")

 

0 votes
Corinne Guibert
Contributor
September 16, 2025

I'm 

When do you want the rules to be executed :  when the last subtask is closed ? Or doing a hourly check is enough ?

 

your first automation runs when there is a transition to Open or Reopen. It should be Done (or whatever closing status your are using)

What is your selection criteria on the scheduled automation ?

Sierra Lindamood
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 16, 2025

What needs to happen is when the last linked item is closed, that then closes the primary ticket that all of the linked items are connected by. 

The scheduled aspect was a way I thought I may have to do it, to have the system check that all the linked items are closed to then trigger the rest of what needs accomplished. 

Sierra Lindamood
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 16, 2025

Screenshot 2025-09-16 134400.png

Suggest an answer

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

Atlassian Community Events