Forums

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

issue to look for tasks open but all subtasks closed

E December 10, 2020

I'm looking for the right query that will list up the tasks that are in progress BUT only if ALL subtasks are completed.

I have this query: 

(issuetype = Task and issuefunction in parentsOf("status = completed") and status = "In Progress"))

but this also shows the tasks when one of the subtasks are completed.

How can I change my query so it will only show if ALL subtasks are completed?

 

2 answers

1 accepted

1 vote
Answer accepted
Jens Jakobi
Contributor
December 10, 2020

Hi, 

does this help you?

issuetype = Task and issuefunction in hasSubtasks() AND NOT issuefunction in parentsOf("status not in (Done, Closed)")

 

It uses the JQL function "issuefunction" of the scriptrunner addon and searches for all issues, which are of type "Task" and have subtasks, but excludes all issues which have subtasks which are in the status "Done" or "Closed". The result is a list of issues which have subtasks and these subtasks have to be in "Done" or "Closed". 

You have to exchange the status names as needed for your jira instance. 

E December 10, 2020

Hi,

thank you for your reply and suggestion.  the query as proposed also returns the closed tasks. I added 'and status != Completed' at the end and now it gives me the correct results.

issuetype = Task and issuefunction in hasSubtasks() AND NOT issuefunction in parentsOf("status not in (Completed)")) and status != Completed

Thanks!

Jens Jakobi
Contributor
December 10, 2020

Yes, sorry. I deleted the "and status != Completed" part for my tests. I suggest that you reorder the query for better readability. In this way it is easier to read from left to right what is happening.

issuetype = Task AND status != Completed AND issuefunction in hasSubtasks() AND NOT issuefunction in parentsOf("status not in (Completed)")) 

I'm happy to help :) have fun!

Like Deshnee Boodhram likes this
0 votes
Joel Young July 11, 2023

Here is a manual method that doesn't require buying third party addons for capabilities which should be native to Jira.

  • Do a JQL with some ticket criteria such as for a sprint that you just closed where you saw the unhelpful Jira warning that XX tickets carried over with all of their subtasks closed.  The query might look like se
sprint in openSprints() and type in (subTaskIssueTypes()) and resolution is not EMPTY
  • Open each of the parent tickets in new tabs (middle mouse click for me)
  • Look for parents that aren't closed

Should also be able to do this with the google sheets integration.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events