Open Parent Issues with All Subtasks Closed

I'm looking for the best JQL query to provide a list of all open standard issues where every subtask has been closed. I've been using Script Runner to come up with some pretty great queries but I can't seem to get it to work in this instance.

The closest that I can get is the following query but it doesn't seem to check whether every subtask is in the closed stauts, apparently just one of the subtasks:

project = PROJECT AND issuetype in standardIssueTypes() AND status != Closed and issueFunction in parentsOf("project = PROJECT and status = Closed")

Can anyone help me refine this query or use another one that accomplishes what I need?

3 answers

1 accepted

Hi Ryan,

I don t have enough subtasks in our tickets to test it properly, but I edited Vijays statement a little bit: as you get issues where subtasks are both open and closed, I made one subquery to a "not in status != closed". Hopefully that works...

project = PROJECT and issuefunction in parentsOf("issuefunction in subtasksOf(\"issuefunction not in parentsOf('type in subTaskIssueTypes() and status != closed') and status != closed and type in standardIssueTypes()\") and status = closed")

This one seems to work. I was able to return all open tickets where all the subtasks are closed. It also seems to ignore any open tickets with no subtasks. Great job to both Jochen and Vijay! Thank you so much.

This was challenging :)

Here is the JQL.

issuefunction in parentsOf("issueFunction in subtasksOf(\"issuefunction in parentsOf('project= PROJECT and type in subTaskIssueTypes() and status = closed') and status != closed and type in standardIssueTypes()\") and status != closed")

Hope this works for you.

Vijay.

Hi Ryan,

I gave a thought again and found an easier solution. Find all the tasks that are open, exclude all the tasks that has open subtasks.

Here is the JQL

project = PROJECT and type in standardIssueTypes() and status != closed and not (issueFunction in parentsOf("project = PROJECT and type in subtaskIssueTypes() and status != closed"))

The problem here is it returns a task even if doesnt have any sub tasks.

Hi Vijay,

Thansk for your prompt response. I tried the query but it seems to not respond with open parent tickets with all subtasks closed. I see open tickets with only a few, but not all, subtasks closed. Any other ideas?

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,319 views 14 20
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot