Forums

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

JQL Query to find Epics where only issues remaining meet a particular criteria

Lea-Anne Gaffney November 21, 2022

Hi,

I have been struggling with putting together a query to give me the results I need. I'm hoping someone here might be able to help.

I want to be able to identify certain Epics that are only waiting on certain tasks before the Epic can be marked as Done.

The query I have so far is:

project = "ABC" AND issuefunction in epicsOf("statusCategory != Done and labels in (ABC)") AND issueFunction in epicsOf("statusCategory = Done and labels not in (ABC)") AND status = "In Progress" AND (labels is EMPTY OR labels not in (ABC))

This query includes the Epics I'm looking for, along with some others, but it's still not 100% what I need. I want it to return Epics where the ONLY open issues inside have certain labels and everything else is Done. 

Can anyone help or know if this is possible? 

Thanks, 

Lea-Anne

 

1 answer

0 votes
Trudy Claspill
Community Champion
November 21, 2022

The possible combinations of StatusCategory and Labels in the issues is

StatusCategory  Labels 
not Done  includes ABC 
not Done  is empty 
not Done  is not empty and does not include ABC 
Done  includes ABC 
Done  is empty 
Done  is not empty and does not include ABC

To get the Epics that have not Done issues with Labels including ABC you already have the first step

issuefunction in epicsOf("statusCategory != Done and labels in (ABC)")

You then need to exclude any Epics that have not Done issues that don't match that criteria

and not issuefunction in epicsOf("statusCategory != Done and labels not in (ABC) or labels is Empty")

I believe that will work.

This part of your filter

project=ABC ... AND status = "In Progress" AND (labels is EMPTY OR labels not in (ABC))

is going to be applied to the Epics that are returned. Is that what you intended? After filtering by the child issues of the Epics, you then want to additionally filter the Epics the the Status and Labels and Project of the Epics themselves?

Lea-Anne Gaffney November 22, 2022

Hi Trudy

Thanks for your reply. 

You then need to exclude any Epics that have not Done issues that don't match that criteria

I'm looking for the opposite here. I want the issues that don't include those labels to be Done. That's why I had 

issueFunction in epicsOf("statusCategory = Done and labels not in (ABC)") 

The problem is that this doesn't ensure that ALL issues that don't have those labels are done. Once it finds one issue that meets the criteria it returns that Epic which I don't want.  I want to only show Epics where the ONLY remaining open issues have a certain labels and everything else is closed. I hope that makes sense. 

After filtering by the child issues of the Epics, you then want to additionally filter the Epics the the Status and Labels and Project of the Epics themselves?

Yes that's correct. 

Thanks for the help, 

Lea-Anne

Trudy Claspill
Community Champion
November 22, 2022

I'm not sure that I'm understanding what you are trying to select.

Given these possible combinations of Status Category and Labels for child issues in an Epic:

 

Status Category  Labels 
 not Done

 includes ABC

 not Done  is empty
 not Done  doesn't include ABC
 Done  includes ABC
 Done  is empty
 Done doesn't include ABC

What is the acceptable number of child issues in each category for which you want the Epic to be included in your results?

I understand that Row 1 represents the first part of your criteria, but I am unclear about the second part of your criteria. I think the combination you want is Epics where these are the acceptable number of child issues:

 

Status Category  Labels  Ok # of child issues
 not Done

 includes ABC

> 0

 not Done  is empty 0
 not Done  doesn't include ABC 0
 Done  includes ABC 0
 Done  is empty >=0
 Done doesn't include ABC >=0
Lea-Anne Gaffney November 23, 2022

Hi Trudy,

 

Let me try and make it a bit clearer what I'm trying to achieve using your table as a reference.

not Done | includes ABC | > 0

I want there to be issues in the Epic that have certain labels that aren't Done

not Done | doesn't include ABC | 0 

not Done | is empty | 0

I want all other issues that don't have certain labels to be Done 


Done | includes ABC | >=0 

Some issues with certain labels may be Done but there could be remaining issues with those labels that aren't Done

Done | doesn't include ABC | ALL 

Done | is empty | ALL 

I want all issues that don't have certain labels to be Done 

 

I hope that makes it a bit clearer what I am looking for. 

 

Thanks for the help, 

Lea-Anne

Suggest an answer

Log in or Sign up to answer