Need to find all Parents where all Sub-tasks are Completed

Mathew Lederman
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 18, 2023

Can anybody help me with a JQL function to find the parent-tasks where all sub-tasks are completed? The queries I've tried so far find parents where some sub-tasks are completed, but not all. 

I've tried something like this but again, it returns parents with some sub-tasks completed rather than all: 

project = "Request Management (New)" and issue in subtasksOf("issue in parentsOf('status not in (Closed, Canceled, Resolved)')")

I've also run into the issue due to the complication of this script that it's crashing the node I'm on so I'm running this in our Dev instance.

I do have ScriptRunner installed on my instance so I can take advantage of those functions.

1 answer

0 votes
Laurie Sciutti
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 18, 2023

Hi @Mathew Lederman ~ try this:

 

issueFunction in parentsOf("statuscategory = Done")
Mathew Lederman
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 18, 2023

@Laurie Sciutti made this a bit more robust, but it still pulls in issues where some sub-tasks are completed and some are not. Also I'd like to pull specific statuses rather than the category as I need to treat different statuses within the category Done differently.


issueFunction in parentsOf("project = RQM and statuscategory = Done") and StatusCategory != Done
Laurie Sciutti
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 18, 2023

@Mathew Lederman ~ ah.  OK....try this (add the additional Done status' as needed in the sub-query):

 

NOT issuefunction in parentsOf("project = RQM and status not in (Done)")and StatusCategory != Done
Mathew Lederman
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 18, 2023

Unfortunately that's pulling in any ticket where the parent is not in a Done status. Not sure it's really doing anything for the subtasks as tickets are being pulled in that don't even have sub-tasks

Tweaking what you provided, this is close, but again still pulls in parents with some Done and some To Do sub-tasks:

StatusCategory != Done and project = RQM and issuefunction in parentsOf("project = RQM and status in (Resolved)")

I tried adding
AND issuefunction in parentsOf("project = RQM and status not in (Open)")

But the result doesn't change. The Parent with one Resolved and one Open sub-task is still showing up,

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events