JQL to show resolved sub-tasks only if the parent Story is Unresolved

Chris Puffe February 11, 2021

Trying to use Plans to create a view that shows all open stories, and the subtasks underneath them regardless of status.  

I've tried the following but this shows sub-tasks for completed stories as well:

project = XXX AND issuetype = Story AND status in (Blocked, Deploy, "In Progress", QA, "Ready for QA", "To Do") or project = XXX AND issuetype = Sub-task AND status in (Blocked, Deploy, Done, "In Progress", QA, "Ready for QA", "To Do") ORDER BY status DESC, created DESC

 

Looking to include completed sub-tasks of an issue, but only when that parent issue is still open (unresolved).  Completed sub-tasks for resolved parent issues should not appear.

2 answers

1 accepted

1 vote
Answer accepted
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 11, 2021

Hi @Chris Puffe 

I do not believe that you can perform that type of query with out-of-the-box JQL.  It would require checking the status of children to select their parents.

There are marketplace add-ons for JQL scripting which could help do this, such as ScriptRunner.

And... Your existing query uses AND and OR statements, but does not group them with parenthesis to enforce the operation order you want.  You probably want something like:

(condition1 AND condition2) OR (condition3 AND condition4)

Best regards,

Bill

Chris Puffe February 11, 2021

Thanks Bill.  I've seen ScriptRunner mentioned a few times in different contexts and wanted to give it a shot.

Cheers. C

Like Bill Sheboy likes this
0 votes
Kristian Walker _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 12, 2021

Hi Chris,

I can confirm that ScriptRunner for Jira Cloud provides the subTasksOf() JQL function which can be used to search for subtasks below an issue that match a certain query and this function may help you to achieve your requriements.

Regards,

Kristian

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