How to list all stories and subtasks of an epic?
Asked by Joao Santos:

Hi everyone,

Is there a way, using JQL, to list the epic, all it's stories and subtasks on the same list?

I am using a team managed Project and saw some references to ParentEpic but it doesn't work, somehow it only returns the actual epic.

Any way to achive this without using third-party apps?

thank you in advance.


Answers:
author: shiva kumar Gosul
body: certainly, you can count the number of Tasks linked to corresponding epic.

Go to Issues or structure and use this jql query "Epic link" = ABC-123

Above query will fetch all user story, Tasks and Defects if linked, if you want to know only Tasks or Story then

"Epic link" = ABC-123 AND issues Type = Task

ABC-123 is Epic key. Let me know if you need further support.

All the Best!

comments: author: Trudy Claspill
body: This does not fulfill the requirement to also get the **subtasks** under the child issues.
> list the epic, all it's stories and subtasks


author: shiva kumar Gosul
body: Yes, above query is for user story and Tasks. To fetch sub-tasks too use belie extended query

Epic link" = ABC-123 AND issues Type in (story, task, sub-task, technical task)


author: Trudy Claspill
body: Your syntax is invalid.

It must be **issuetype** or **type** rather than **issues type**

Additionally, even with that corrected, your JQL does not return the sub-tasks under the issues that are within the Epic. The Epic issue key is not recorded in the sub-task issue.


author: Trudy Claspill
body: Hello [@Joao Santos](/t5/user/viewprofilepage/user-id/5029037)

I believe this will give you what you want:

<https://support.atlassian.com/jira-software-cloud/docs/jql-functions/#linkedissue>

linkedissue = *epic-issue-key*

comments: author: Joao Santos
body: Hi [@Trudy Claspill](/t5/user/viewprofilepage/user-id/3569011)

that behavior probably changed since it is only returning the epic itself

![example_linkedissue.JPG](https://community.atlassian.com/t5/image/serverpage/image-id/346778iF4D7C16B5B722A42/image-size/large?v=v2&px=999 "example_linkedissue.JPG")


author: Trudy Claspill
body: It worked within my instance to display all the child issues and subtasks of those child issues, for an Epic in a Company Managed Software project.

Can you provide a screen image of BC-1247 showing enough of the issue to show that it has child issues?

Example:

![Screenshot 2024-09-11 at 2.52.43?AM.png](https://community.atlassian.com/t5/image/serverpage/image-id/346788i9FB3D1165201EE20/image-size/large?v=v2&px=999 "Screenshot 2024-09-11 at 2.52.43?AM.png")


author: Joao Santos
body: Sure [@Trudy Claspill](/t5/user/viewprofilepage/user-id/3569011) !

in this print you can see that it has 5 stories and one of them has a subtask.

![example_Epic_3.JPG](https://community.atlassian.com/t5/image/serverpage/image-id/346791iD3D3352A8044D485/image-size/large?v=v2&px=999 "example_Epic_3.JPG")


author: Trudy Claspill
body: What is the Type for the BC project?

Get that information from the Type column on the View All Projects page under the Projects menu.

Can you provide a screen image from the details view of the Epic, like the one I provided?


author: Joao Santos
body: It's a Team-managed software.

We are using kanban template, not scrum, so I don't think I have that view (at least I don't know where to get it...)

any specific information or field you wanted to check?


author: Trudy Claspill
body: You can get that view by clicking directly on the issue key for the Epic to open the view that shows all the details of the Epic issue.

The linkeIssues option does not appear to work for Team Managed project; only for Epics in Company Managed projects.

parent=*epic-issue-key*

...will give you only the direct children of the Epic from a Team Managed project, not the subtasks of the children.

Jira does not natively support a way to get a list of subtasks based on a dynamically derived list of issues, so for your Team Managed project I think you will not be able to satisfy your requirement without a third party app.


author: Martin Fredrich
body: I was wrong!  

In Jira Cloud, the `linkedissue` function now **does** support the `Epic-Story` relationship, and you can use it to retrieve all Stories, Tasks, and Subtasks related to a specific Epic.

> `linkedissue = ABC-123 `

Where `ABC-123` is the key of your Epic, it will return:

* The Epic itself.
* All Stories and Tasks linked to the Epic.
* Subtasks under those Stories and Tasks.

This is a recent change in Jira Cloud, and it simplifies the process of retrieving all issues related to an Epic without needing to use the `"Epic Link"` field or complex parent queries.

Thank you [@Trudy Claspill](/t5/user/viewprofilepage/user-id/3569011)

Kind regards  
Martin

<br />

In Jira Cloud, there is no built-in way with pure JQL to list both an epic, all its stories, and their sub-tasks in a single query, as JQL doesn't natively support hierarchical queries.

comments: author: Joao Santos
body: Hi [@Martin Fredrich](/t5/user/viewprofilepage/user-id/3883986)

maybe that relationship is recent?

it doesn't seem to be working... please check my print on the reply above... am I missing something?


author: Martin Fredrich
body: this is what I get with linkedissue = NINXXX-3  
![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/346779i008F81E29DB20FD0/image-size/large?v=v2&px=999 "image.png")

All related issues have the Epic as parent:  
![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/346787iD8A70BC97FA08E6A/image-size/large?v=v2&px=999 "image.png")


author: Joao Santos
body: For some reason that is not working for me:

when I filter using linkedIssue='My_Epic' I get only get the actual Epic.

when I filter using Parent='My_Epic' I get only get the stories.


author: Trudy Claspill
body: That is because your Epic is in a Team Managed project.


Tags: cloud

jira-cloud