JQL to show all issues and subtasks in an epic

Jacqui Pretty July 15, 2020

Hi there,

 

I'd like to create a JQL filter to show all the issues and subtasks in an epic. There was already a discussion on it that's been marked as solved (https://community.atlassian.com/t5/Jira-Software-questions/JQL-to-show-all-issues-AND-subtasks-in-the-Epic/qaq-p/346433), but none of the answers provided solve the problem - they can show the issues in an epic, but none of them show subtasks as well (note that I only tried the JQL and didn't try any of the third part tools recommended).

 

Basically, I have an annual epic with weekly issues and daily subtasks. Each week gets cloned, with the details of the daily tasks being updated, but the cloning works because the structure of each week is the same.

 

I'd like to create a filter that shows all the subtasks. Note that because we're not creating all of these tasks up front, I can't create a filter with 52 tasks and then be done for the year, so it needs to be something that can update as new tasks are added. I was hoping to do something based on the epic, but since the subtasks are only linked to the epic through the issues (so, no direct link), this doesn't seem to be possible.

 

Has anyone found a way to make this work?

9 answers

2 accepted

112 votes
Answer accepted
Paul Matteucci July 8, 2021

You can get that with the command "parentEpic"

parentEpic in (EPIC-1, EPIC-2)

Enjoy! 

rudy.duke@nih.gov November 10, 2021

QED!

Like # people like this
Michiel V_ December 3, 2021

Give this man more upvotes, no addons or extensions needed!

Like # people like this
Tony Woodall December 13, 2021

Spot on! The only answer I needed to create plans based on specific Epics and not by projects but still shows all tasks and subtasks.

Like # people like this
Paul Ionese January 12, 2022

Thank you sir!

Like # people like this
Ryan Gill January 21, 2022

Bless you, hero

Like Michiel V_ likes this
orrin.ward February 2, 2022

When did this happen?

It's magic, and I swear this didn't exist a few years ago. I used to achieve it with Scriptrunner stuff, but then lost that capability when switching to a company without Scriptrunner.

Vera Kartalou March 9, 2022

Works like a charm! Thank you so much!

Like Michiel V_ likes this
Bonnie Caruso March 11, 2022

Thanks for this!  Now, how do I get the sub-tasks under all of the stories and tasks linked to the epic (next layer down)?

Like # people like this
Ryan Gill March 11, 2022

 

@Bonnie Caruso 

issuekey in portfolioChildIssuesOf("KEY-123") where KEY-123 is the epic you want to base the search on

Like # people like this
Bonnie Caruso March 11, 2022

That worked perfectly - thank you so, so much!!

Like Ryan Gill likes this
Stéphane Chapron March 30, 2022

Thank you

Like Michiel V_ likes this
Daniel Zimmermann April 28, 2022

+1 - thanks!!

Karie Price September 9, 2022

WOO HOO!! Thank you!!

raje September 26, 2022

@Paul Matteucci I have a question on top of above, perhaps you know.

I'll like to see all task and epic for a specified release, I have marked all the epics with the fixversion, but some of the tasks are not marked to this release.

Is it possible to add a release the 2 epic names with a query. 

I have tried lots of different version of below, and I don't understand why it is not working.

parentEpic in (fixVersion=123)
Like # people like this
Amanda Culver November 11, 2022

CAVEAT :

Unless the epic you're trying to expand is in a Teams Managed Project - Then, you're just presented with the epic and none of its contained issues.

Like # people like this
Brook Warner November 27, 2022

You can use `parent =` in TM projects. https://jira.atlassian.com/browse/JSWCLOUD-17239

Like # people like this
Christopher Baca February 1, 2023

Thanks for posting this caveat. The solution was only returning a single link to the epic.  

After some trial and error and investigating the JQL interface, I found I could get a listing of the children of the epic but had to add the project name. And the syntax ended up looks a little different. 

So my query ended up looking like this: 

project = PTC AND parent = PTC-493 

where

  • PTC is the name of the project that contains the epic I am interested in. 
  • PTC-493 is the code for the epic

I copied this line from the JQL editor in Jira, then pasted it into my Confluence page using the /Jira shortcut to get at the Insert JIRA Issue/Filter dialog, Confluence liked that query and displayed a table of the child tasks in the PTC-493 epic. 

Like # people like this
Alan Ferneyhough July 7, 2023

Amazing thanks!!!

Like John Funk likes this
Stephanie Rydell October 26, 2023

@Christopher Baca THANK YOU!!!!!! scratching my head on this one for awhile. Teams Managed Project

Srinivaas February 5, 2024

How about multiple epics children display

Michael Szustakowski February 13, 2024

It took me way too long to find this function.  THANK YOU!!!!

12 votes
Answer accepted
Jack Nolddor _Sweet Bananas_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
July 15, 2020

Hi ya, this is Nolddor from SweetBananas vendor.

Sadly you cannot achieve the desired search using standard features on Jira, you must go for a third-party app instead. Using i.e. JQL Booster Pack (if you are on Server / DataCenter) you can type the following:

 

1) Find all task under a given Epic (i.e. EMEA-2459)

"Epic Link" = EMEA-2459

2) Find all subtasks under returned issues above

issue IN subtasksOf(' "Epic Link" = EMEA-2459 ')

3) All together (Epic, Task & Subtask)

key = EMEA-2459 OR "Epic Link" = EMEA-2459 OR issue IN subtasksOf(' "Epic Link" = EMEA-2459 ')

(*) Note that this is just an example, you must tune above query to fit your needs.

 

Using this app you can also query other issues relations, check:

 

Regards

mochadwi October 31, 2021

Jira since then changed a lot. Now the JQL named as linkedissue e.g:

 

linkedissue = SAPP-10885 OR linkedissue = SAPP-10787

 

It'll filter the issue linked in the SAPP-10885 (in this case epic key) or SAPP-10787

 

The SAPP-XYZ was just an example

Like # people like this
7 votes
Steve Gonzales April 8, 2022

None of these suggestions work and it is absolutely mind boggling that there is no easy way to do this.

Paul Matteucci April 11, 2022

Sorry it doesn't work for you.

Can you share what you're trying to do and what platform you're on?

Meghan Duffy May 24, 2022

This also does not work for me, and I can't tell if I'm missing something because this also seems very intuitive and like it should be simple to me.

-Like OP, I want to see all the issues and subtasks in an epic. 

-I don't know how to answer the question of what platform I am on (using enterprise software from my company).

For example, let's say I am in my project of "Running a Household", and working on an Epic of "Cooking Dinner", and this Epic of cooking dinner might be grouped in with other Epics under the initiative "Eating Healthy". I am in the backlog of Running a Household, and I want to take a look and review how things are going for our "Cooking Dinner" Epic - what user stories have been made, what problems and issues and subtasks need to be worked on all in one view. Intuitively I want to just search for my Epic or initiative in the backlog or use advanced search.

Right now, I can see *all* the issues for a project. But, I can't seem to just search for the epic name or number (TD-236) and have the same view but filtered for anything in that Epic. I also would like to use this same strategy for initiatives to view all epics with their issues in an initiative, and using the search/advanced search option.

If you have the epic panel turned on, then in the backlog view you can select your Epic to filter (which is basically what I am going for here!). However, if you have a lot of epics going that is still not ideal because you have to do a lot of scanning and scrolling to find your epic. And it does not help you in the advanced search field, or if you don't have epic panel, or if you want to search by initiative.

Like Steve Gonzales likes this
Steve Gonzales May 24, 2022

@Paul Matteucci What do you mean by "platform"? We are using Atlassian cloud Jira. This happens in Chrome, Firefox, Edge, Safari, everywhere. It is limitation of Jira, one of the dozens if not thousands of them. Mind blowing that no one thought to write this...although I seem to remember Green Hopper (or whatever the original Agile tool was called) doing this. Likely got deleted by some over zealous object oriented developer.

Ryan Gill May 24, 2022

@Meghan Duffy on JIRA Cloud, the following works for me.

Do an Advanced issue search, with your query as:

issuekey in portfolioChildIssuesOf("TD-236")

Like adam.quinn likes this
Steve Gonzales May 24, 2022

Doesn't work.

Like # people like this
Ryan Gill May 24, 2022

@Steve Gonzales ah, sorry, the solution I proposed was on an instance with Jira premium including advanced roadmaps. The portfolio commands are tied to premium as they are advanced roadmap functions.

I just tested this on a trial plan and it worked:

parentEpic = TD-236

From @Paul Matteucci 's solution below


Roberto Rolon May 25, 2022

Hello @Ryan Gill 

I tried what you posted.

literally this

project = projectname and parentEpic in (EPIC-1, EPIC-2)

and what I get is just a list with the 2 epics, but none of the issues children of those epics.

What am I doing wrong ?

Thanks a lot !

Like # people like this
Ryan Gill May 25, 2022

@Roberto Rolon 

That's pretty confusing! It's working for me on my personal cloud test instance following the same query. 

I ran this in my instance and it worked:

project = SCRUM and parentEpic in (SCRUM-1, SCRUM-2)

As you can see, I got results with stories and subtasks!

 

parentEpic.PNG

Like raje likes this
Roberto Rolon May 25, 2022

Hmmm. Weird.

Thanks for checking.

I'm new to this instance (I didn't create it) and I see we don't have available some fields, such as Epic Link.

Do you know if it could be anything at the project setup level ?

 

Thanks a lot @Ryan Gill !

Roberto Rolon May 25, 2022

Ok ,solved.

It worked with command "Parent", not parentEpic.

Weird, but it worked.

 

Thanks !

Like # people like this
Steve Gonzales May 25, 2022

@Roberto Rolon That actually works! Thank you so much. It's not great because it crams all the results in like half a column, but it does work. It's mind blowing that Atlassian doesn't document this and won't even monitor threads like these. I know some people who refuse to use any Atlassian product and it's stuff like this that drives people mad.

Like # people like this
2 votes
Midhun C_N March 13, 2023

issuekey in ( childIssuesOf("SDT-438"), childIssuesOf("SDT-439") )

 

This solution worked for me. The above query will list all the issues under the EPIC's SDT-438 and "SDT-439"

1 vote
DD September 4, 2023

issuekey in childIssuesOf("<epicIssue>") works like a charm! thx @David Hiatt ;-)

1 vote
Jermaine Fulton October 11, 2022

To return linked issues in Jira:

Use:  Issuekey in (linksHierarchyIssue("KEY-123"))

Where:

if "Key-123" is a Sub-task, the query returns the Parent (e.g. Story) and the Parent's Parent (e.g. Epic)

 if "KEY-123" is a task level (e.g. Story), the query returns the Parent (e.g. Epic), any other stories within that Epic, and the original issue's sub-tasks.

 if "KEY-123" is an Epic, the query returns everything below that Epic (Stories and their sub-tasks), and if that Epic happens to be a child of anything higher (e.g. New Feature, Initiative), it also returns that Parent ticket. 

Bonus:  Include another parameter to expand your results:  

Issuekey in (linksHierarchyIssue("KEY-123",2))

 if "KEY-123" is an Epic, the query returns the Parent (e.g. Feature) and the Parent's Parent (e.g. Initiative), as well as all issues beneath that highest level in the hierarchy (Initiative), and any adjacently linked issues, dependencies, related issues.  It also extends to any issue at the same level as its parent issue (e.g. Feature) that is under the top hierarchy issue (Initiative).  - This assumes your project has levels above Epic.  

This methodology works for any issue type that has parent and/or epic links.  Youcan increment the additional parameter to "Widen" the search results and return parallel issues of the highest level issue returned and any other issues that share a parent with that ticket.  In this case, it would be the project itself.  Thus it would return all initiatives in the project and all of their Features, Epics, Stories, and Sub-tasks.

Gil Groman February 13, 2023

This is the only thing that worked for me. thank you!

Like John Funk likes this
DD September 4, 2023

nope, doesn't work in Jira Server ;-(

Amanda Culver September 5, 2023

linksHierarchyIssue

is a function offered by Kintosoft in one (or more) of their plugins 
JQL functions - Links Hierarchy (Old) - Marketplace Expert SL (atlassian.net)

0 votes
GeeLong August 28, 2023

This works for me when I want a filter for the following scenario. 
Project A and
Project B, particular Epic and its child issues

project in (ProjectName) OR project ="ProjectName" AND linkedIssue = Epic ID

For illustration purposes:

project in (Alpha) or project ="Beta" AND linkedIssue = BETA-100

0 votes
Denes Gacsal June 7, 2023

I think I will hang my self. all today I was tring to solve this question, how to list all the issues (task, sub task, open item...) of an Epic and still nothing suceed. Nevertheless, what I really can't understad, a software, made for this kind of tracking, needs so many extensions to solve his job. Its like I would have a watch but I need to buy extensions to know the current time. 
super.

maybe I will take another try tomorrow with cooled down head. Until that, I would ask some help. My project looks like this

My project

  • Open item 1
    • Epic 1
      • sub tasks
      • Open item
        • sub tasks 1
        • sub task 2
      • Open item 2
        • sub task 1
        • subtask 2
      • sub tasks xxxx
      • subtask yyyy
    • Epic 2
    • epic 3...
  • Open item 2 (for example Serial production topics)
    • Epic 1 (a really nice problem)
    • Epic 2 ( another production show stopper)
    • ...

I am looking for a query to list EPIC1 into a kan ban table. 

my closest solution to Eden:= JQL: project = ASCSENG AND issueFunction in linkedIssuesOfAllRecursiveLimited("issue = ASCSENG-62 ", 2) ORDER BY Ranking ASC  -->  but this shows Epic 2 as well under Open item 1 and I could not find a good was to exclude it.

 

thanks for suggestions.

Steve Gonzales June 7, 2023

1,000% correct @Denes Gacsal and nearly THREE YEARS later and this is still deficient. Atlassian is sure good at collecting a monthly fee...making their software usable...not so much.

Like # people like this
0 votes
Daniel Turczanski - __JQL Search Extensions
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
July 8, 2021

Hi @Jacqui Pretty ,


As you're on Jira Cloud the correct answer is to get an app that provides JQL extensions you're looking for.

With standard JQL you can only get a list of issues and export them to Excel for further processing. This works if you want to do a one-off analysis. Your use case is more dynamic than that.

Standard JQL doesn't easily allow it but the results can be quickly found using our professional indexing service:

After you install the app you can simply search:


issue in childrenOfIssuesInQueryRecursive("project='ACME' and type=Epic") and type=Subtask

The query finds all children of your epics and even children of their children - these are your subtasks. You may want to check out the docs as well.

I hope this helps!
Daniel

Paul Matteucci July 8, 2021

Daniel,

you can use the command parentEpic

parentEpic = EPIC-1

without the need for external packages.

Cheers

Paul 

Like # people like this
Daniel Turczanski - __JQL Search Extensions
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
July 12, 2021

That's right. Standard JQL has support for basic searches like that. If you have a static list of issue keys then you're fine with vanilla JQL. If you need the queries to be more dynamic then it's a good idea to search for JQL extensions.

David Hiatt March 25, 2022

Doesn't appear to work for Data Center 8.13.13...anyone know what version supports this JQL?  Unless I botched the syntax, but it seems pretty simple.  Thanks for anyone that considers this, screenshot of what I am getting in subsequent reply.  

Like # people like this
David Hiatt March 25, 2022

here's what I see when try it : jqlfail.jpg

Like Sean likes this
David Hiatt March 25, 2022

if it might help anyone else, the following achieved what I wanted (all issues under epic including sub-tasks) as an alternative to the other options earlier in this post:  

issuekey in childIssuesOf("BCFEX-50")

where "BCFEX-50" is the issue key of the Epic

Like # people like this
Seamus Newman April 12, 2022

@David Hiatt 

This is the one that worked for me. Wish this was higher up! 

+ rep

Like # people like this
Robert Hanna May 18, 2023

issuekey in childIssuesOf("<epicIssue>") worked for me. This should be the defacto answer.

Thanks again!

Micheal Planck June 13, 2023

It's either Parent or ParentEpic, depending on whether it's Team Managed or Company Managed.

You might ask why Atlassian would do that to itself; to make the epic link a different name based on a management scheme. But that way madness lies; questioning why Atlassian does anything is a fools errand.

Abhinay Sinha September 25, 2023

キャプチャ.PNG

Does not work for me :(. Here AHS-5937 is Epic ID

Alan Ferneyhough September 26, 2023

Try parentEpic = AHS-5937

Tej October 25, 2023

Yes, this works for one Epic issuekey in childIssuesOf("<epicIssue>")

What about multiple epics? any other way?

Is it issuekey in ( childIssuesOf("SDT-438"), childIssuesOf("SDT-439")  ?

Sangeet Agarwal
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 27, 2024

Hello All,

I want to get the reverse of it. Say, I have a few stories & I want to list the epics of these stories. Can I have it without using any plugin in JQL Query?

Thanks in advance

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events