JQL Filter to find Epics that have no Issues (i.e. empty Epics)

Glyn Costello September 14, 2015

Hi, 

I'd like to know how I can use a JQL query to collect Epics which do not yet have any issues linked to them. 

It seems that I can find issues which have links out to an Epic, but not necessarily the other way round. 

I'm looking for something like:

IssueType = Epic AND HasChildren = No

Please help?

Thanks, 

Glyn

6 answers

2 votes
Emanuel Felix Tunbjer January 11, 2016

Hi @Jennifer McVicker

If you are on a Server JIRA you can use the add-on ScriptRunner for JIRA from Adaptavist, to easily create queries around Epics:

issueFunction in hasLinks("is Epic of") - to show all epics that has stories defined

issueFunction not in hasLinks("is Epic of") - well, to show all epics that has no stories defined

Cheers

Glyn Costello January 11, 2016

Hi, I'm aware it can be done with script runner, however it is not part of our installation. Based on the responses I thinking that there's no JQL query that can handle this kind of request...

Like Bertrand_SCHNEIDER likes this
Jennifer McVicker April 28, 2017

Awesome!  We do have ScriptRunner installed on our Server instance.  I'll check that out.  Thanks Emanuel!

Matt Boerner November 7, 2017

Is there a way to hide epics without any associated stories given the currently applied quick filters?  That query hides ONLY those epics without ANY associated stories.

Jennifer McVicker November 10, 2017

I haven't been able to get that to work, @Matt Boerner.  I tried adding this to the end of my quickfilter: 

AND (issuetype != Epic OR issueFunction in linkedIssuesOf("[my quick filter here]", "is epic of"))

But that didn't work.  :(

Soren Nielsen April 12, 2018

@Jennifer McVickerdid you get that to work? I can't get it to work :-(

Ste
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 13, 2019

This should work: project = X and issuetype = Epic and issueFunction not in epicsOf("project = X")

Ste

Like # people like this
Stephanie-(ATO) November 13, 2019

@Ste - did you use Script Runner for that query? We are currently not using any plugins or add ons like Script Runner but our members want to be able to see what Epics don't have children so they can work on getting them decomposed by the requester.

However, I cannot find a query via google or the JIRA Communities that would allow me to put together a query for that without using Script Runner or a tool like Script Runner.

Has anyone found that this (a query for Epics with no children) is possible without another tool , in JIRA?

Stephen Wright _Elabor8_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 22, 2019

Hi @Stephanie-(ATO)

Not that I know of - you need more powerful queries to allow you to do this. 

Without any app, you'd have to take more manual steps - such as:

  1. Search for all Epics in your instance and export them to CSV
  2. Now search for all stories (or issues of a similar hierarchical level) and export. Ensure the Epic Link field is one of the exported columns
  3. Copy the Epic Link column from the second CSV into a new sheet on the first CSV
  4. De-dup the Epic Link column to give you all Epics which have subordinates
  5. On the first sheet, VLOOKUP to the Epic Link list to see which ones are on it - those which aren't have no stories

^ This seems like a lot of manual steps though - is there a reason you wouldn't want to get ScriptRunner or another JQL enhancer (there are many!)?

Ste

1 vote
Arthur Lee March 24, 2021

Oddly, there was an answer using JQL Search Extensions above that didn't work for me. Instead, I had to use this JQL for my search. Adding this here in case it helps some other folks...took me a while to get this working.

issue not in epicOf("'Epic Link' is not empty")) ORDER BY rank

 I use Structure as well; in my one filter, I wanted to show all the other issues as well, so I had JQL something similar to the following:

issuetype not in (sub-task,test, epic) or 
(issuetype = Epic and issue not in epicOf("'Epic Link' is not empty"))
Egil Sandfeld April 6, 2021

Perfect, I made this work for me when I had to find Epics without stories:

not issueFunction in epicsOf("'Epic Link' != null")
1 vote
Jennifer McVicker December 23, 2015

I'm looking for the answer to this too...or rather, the reverse.  I have created a board that pulls stories and epics from multiple projects, and I want to ONLY pull in epics that contain one or more stories that display on my board.  For instance, an epic may have three stories but those three stories are filtered out by my board filter, so the epic shows up on the backlog screen, but contains no stories on my board.

1 vote
GabrielleJ
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 14, 2015

"Epic Link" is EMPTY for issues *NOT* linked to an epic

"Epic Link" is not EMPTY for issues linked to an epic

Glyn Costello September 23, 2015

Hi, this doesn't really answer the question. Your first query will show my issues without an epic link. I am trying to find Epics with no stories in them.

Like Susan McCasland likes this
Deleted user April 25, 2016

I'm looking for this as well finding jQL to find Empty Epics to clean up Agile Board view of epics that are no longer needed and to provide easily readable list to Lead to review before closing.   

0 votes
Romans Ļubļinskis May 13, 2021

Not in the form of query (which I would also like to have), but other way around:

 

While in Backlog of particular project, click on each (yep...) Epic and check what's inside in the summary below an Epic name.

0 votes
nils_karlstrom February 25, 2020

This is now possible to do if you have the add-on JQL Search Extensions.

issuetype=Epic and issuesInEpicCount=0
Deleted user February 25, 2020

This is a paid add-on.   :(. 

nils_karlstrom February 25, 2020

Yes, but it's one of the only options. It's not possible with standard JQL.

Suggest an answer

Log in or Sign up to answer