Forums

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

Automatically close Parent Issue when all Sub-task TYPES are closed

Justin Jones January 19, 2024

Hello All,

I have read many useful posts on how to "automatically close Parent Issue when ALL Sub-tasks are closed", but my request is more nuanced in that I have the same need, except I have sub-task TYPES underneath any one Parent ticket (https://community.atlassian.com/t5/Jira-Software-questions/Can-issue-types-consist-of-multiple-sub-task-types/qaq-p/1960180). Regardless of what these sub-task types are used for in my line of work, lets call the additional subtask types "sub-task type B" and "sub-task type C":

I would like my parent ticket to close when any combination of my standard sub-task along with "sub-task type B" OR "sub-task type C" are marked "Done". 

I can easily foresee previous helpful posts (https://community.atlassian.com/t5/Jira-Software-questions/Automatically-close-Parent-Issue-when-ALL-Sub-tasks-are-closed/qaq-p/2348281) as not working in my case since if I have a combination of sub-task types, if 6 of 10 sub-tasks are our standard sub-task, but I also have a few "sub-task type B" OR "sub-task type C" mixed in there, that the Parent ticket would close preemptively. 

Any thoughts?

1 answer

2 votes
Walter Buggenhout
Community Champion
January 19, 2024

Hi @Justin Jones,

Have you tried it? Sub-tasks (as in related issues) represent a level in Jira's issue hierarchy, not an issue type - unless you explicitly refer to them with an issue type condition.

The previous helpful post you refer to in your question has a screenshot. A condition is being used there - as the second step - that says Issue Type equals Sub-Task. You could either leave that out (but then your automation rule will be triggered way too often) or replace it with:

  • Issue type is one of (and then list your different sub-task issue types) OR
  • use a JQL condition querying for issuetype in subTaskIssueTypes() to make it dynamic

Hope this helps!

Justin Jones January 19, 2024

How's it going @Walter Buggenhout ? Thanks for such a quick response and going out of your way for the help. 

I understand what you're saying when denoting that sub-tasks are relating to the level as a whole. When I tested referring to the linked post, I got this error:
Error 1.png

In fact, this impacted a separate Parent ticket I was not working on and it actually transitioned the Parent ticket to Done even though there were still Sub-tasks in the "To-do" status. 


So my next step was doing as you describe (JQL). Here is my setup:
Screenshot II.png

Interestingly, I get the same exact error as in my first screenshot when going to the Audit Log:
Error 2.png

No idea why , but I have a feeling I'm close to the solution. Happy to post the answer if I'm able to get there! 

Justin Jones January 19, 2024

For good measure, this is how my current automation ends. I did not include the full screenshot in my previous post.Screenshot 2024-01-19 130653.png

Walter Buggenhout
Community Champion
January 20, 2024

Hi @Justin Jones ,

The error suggests that the transition to the Done status is not available for the parent issue you are trying to update. Most commonly, that it is because there is no transition from the issue's current status to Done (the condition status != Done also returns issue in To Do or Backlog statuses).

Another thing I've seen on several occasions is related to team managed projects. Each project may have its own Done status, leading to confusing situations where one Done status is not the other one with the same name.

Finally, it could also be that conditions or validators on your workflow may block the issue from moving to that status automatically. Of course, it's difficult to judge from a distance what may be happening in your specific case, but hopefully these are some useful pointers.

Suggest an answer

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

Atlassian Community Events