Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

JQL to show all issues AND subtasks in the Epic

Is there a way using JQL to query for all issues AND their corresponding sub-tasks for any given epic?

I tried using "Epic Link" = PRJ-1134 , but that only shows my stories, not my sub-tasks that are connected to those stories.

Thank you!

40 answers

2 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

87 votes
Answer accepted

Solution to show all Items in an Epic is this without having to use any plugin:

project = CC AND "Epic Link" = CC-2 OR parent in ("CC-2")

Hope this helps.

BOOM! Thanks Lisa!

Like # people like this

This is great!

What does the "parent in" part do?

Unfortunately this doens't list sub-tasks as they're on issue though... have you been able to achieve this?

Like # people like this

This works only when you have scriptrunner plugin installed

Like # people like this

Doesn't list Sub-tasks, as the original question require. Tested on Jira Software Server 7.3. This shows the issues directly linked to the Epic, not the sub-tasks under stories.

Like # people like this
Kathy Hart Community Leader May 22, 2018

instead of parent use parentEpic = XX-##


This works in Cloud without any plugins. 

Like # people like this

This works in Cloud without plugins for me too.

Thanks Lisa!

Thanks for this

Hi All,

Doesn't list Sub-tasks, as the original question require

Just add "parent in linkedissues()" to get all subtasks.

(Remove "project =" if you have issues in other projects).

"Epic Link" = CC-2 or parent in ("CC-2") or parent in linkedIssues("CC-2")


Like # people like this

@sylvain dupuy, this doesn't work either. Because Sub-tasks can't link to Epic directly.

I've tested your sugestion on Jira Server 7.9.0.

Let's be sensible. In Jira Server there is only one output: plugin (free). In the Jira Cloud (I have no way to test) the solution has already been given. And the question requires to show Sub-tasks! 

Like Eitan yomtovian likes this

Hi @Junio Fernandes,

Did you tried this?

"Epic Link" in (ABC-4820) or parent in havingSubtaskIssuesFromQuery("('Epic Link' in (ABC-4820))")



The first section till "or" returns the parent since all such parents will have linked epic and second part after "or" will only return the subtask of all such parents that are linked to epic.

I am not sure if there is any need to install the script, and to check you can start typing "parent in hav...." if this shows the function "havingSubtaskIssuesFromQuery" you are good to go.

Like # people like this

Hi @Jiten, no, i did not.

It's not my question. I gave an util answer regarding the original post.

But I gave it a try and it doesn't work either. "havingSubtaskIssuesFromQuery" is not a JQL function or it's a plugin JQL function. You could identify the plugin to be more accurate.

Before you post non identified function like this, it's better read this Advanced searching - functions reference for Cloud and this Advanced searching - functions reference for latest Server version.

Deleted user Oct 26, 2018

project = XXX AND (issuetype = Story AND "Epic Link" IN (xxx-###xxx-###xxx-###xxx-###xxx-###)) OR (issuetype = sub-task AND "Parent Link" IN (xxx-###xxx-###xxx-###xxx-###xxx-###))

Like Quinette Docherty likes this


I'm not sure if you're setup differently, but as I understood what you wrote it was not returning the Sub-tasks for me, BUT I was able to get the query to work with one small change -- "Parent Link" to "parentEpic":

(for those who don't follow, the "xxx-###" are the Jira keys for the Epics in question)

project = XXX AND (issuetype = Story AND "Epic Link" IN (xxx-###xxx-###xxx-###xxx-###xxx-###)) OR (issuetype = sub-task AND "parentEpic" IN (xxx-###xxx-###xxx-###xxx-###xxx-###))

Like # people like this

Great! Thanks Lisa

I am just trying to create a report - 

List of all the user stories in each epic and group by epic - 


Epic 1 

User story 1

User story 2

Epic 2 

User story 3

User story 4

Like # people like this

@madhuvardan maybe you should open a new question about "reports". You need to explain your needs, because when you say "create a report" I can understand a new addon, or maybe an msexcel integration, or use of rest api, or just search for issues. 

That said, you can't group it in issue search, but showing correlated columns you should get it and export to excel sheet and use of pivot's table to group the items.

Like Jeremy B likes this
52 votes
Answer accepted

Install the free ScriptRunner plugin and then use the following query where XX-### is your issue key:

("Epic Link"=XX-###) OR issueFunction in subtasksOf("\"Epic Link\"=XX-###")

Like # people like this

Thanks Saikat. That works great, and without having to purchase a plugin.

Like Tim Malone likes this

Doesn't work for OnDemand...

The onDemand APi does not support JQL functions for 3rd parrty add-ons. However, Links Hierarchy for Cloud may help a lot as users can display ful Epics hierarchies graphically and export them intto the Issue Navigator!

[Edited to add picture]


Cool ... This worked...No plugin required... smart Move.!!

wicked cheers for that (we have the Adaptavist script runner plugin), also modified to include, OPEN sub tasks, issues and risks asscoiated with the perant EPIC:
(issueFunction in subtasksOf("\"Epic Link\"=XX-XX") or (issuetype in (Issue, risk) and "Epic Link" = XX-XX) and status not in (closed))

Like Bert Kellerman likes this

Im my case I use AM Utils (free add-on) to search all issues and subtasks on it.

A simple example:

issuekey in (issuesSubtasks("'Epic Link' = XXX-99")) ORDER BY Rank ASC

With this I can make boards that swinlanes with stories or projects besides the Epic Link. 

Like # people like this

Great solution!  Thanks for such an easy way to get all related issues.

Easy solution with localized German Epic Links ;-)

issueFunction in subtasksOf("'Epic-Verknüpfung' = XXX-99")) ORDER BY Rank ASC



@Junio Fernandes This seems to work well if one uses subtasks in Epics, but we use stories and it does not seem to work. When an Epic has only stories associated, I get no results. If I add a subtask to one of the stories within an Epic, then only that one subtask is returned. 

issuekey in (issuesSubtasks("'Epic Link' = XXX-10")) ORDER BY Rank ASC

Looking at documentation, it appears there is only that one function pertaining to subtasks. Are there perhaps other functions not documented? or a fancy way to use the function that you know of?

Because sub-tasks are not directly linked to Epic, you need to query twice. One for the linked issue (like stories) and other for the sub-tasks items in its issues.

That's the way in Server:

"Epic Link" = XXX-10 OR issuekey in (issueSubtasks("'Epic Link' = XXX-10"))

Til last Server version (7.11), there's no native way to query for sub-tasks in Epic. You need the AM Utils free add-on.

Like # people like this

Thanks Saikat!!!

I'm using OnDemand so the plugins aren't available to me. I did notice that this query meant for another product is working...

"Epic Link" in (XXX-####, YYY-###, ZZZ-####) OR parent in tempoEpicIssues(XXX-####, YYY-###, ZZZ-####)

Sweet, that definitely worked for me, specifically

parent in tempoEpicIssues(XXX-####, YYY-###, ZZZ-####)

pulls in all subtasks for a specific epic.


On the similar lines, i want to get all stories for multiple epics and person working on those epics

below query is giving me error!! it is not allowing multiple values for Epic Link!!

project = TEST AND issuetype = Story AND "Epic Link" = (TEST-1275,TEST-955,TEST-966) AND "manager" = userid ORDER BY description

"manager" is in Epic, not in story.

Can somebody help with this query, Appreciate it.


I'm not 100% sure and don't have Epic to test this, but I expect changing your "Epic Link" argument from = to IN will do the trick. Try:

project = TEST AND issuetype = Story AND "Epic Link" IN (TEST-1275,TEST-955,TEST-966) AND "manager" = userid ORDER BY description

Just want to add my thanks for the work around. You're making me look very, very smart at my company.

This seems to rely on Tempo TimeTracker - I don't have this installed. Is it normally installed by default?

Currently, some few add-ons  like Tempo and others, directly run on the Atlassian's Cloud Server instances whereas the rest of the 3rd party Cloud add-ons run on their own Cloud Server instances.

These add-on exceptions will be moved out of the Atlassian's Cloud Server instances. You might want to contact to the add-on Cloud provider in order to know if a feature is long-term supported.because the Atlassian's Cloud API is very limited compared to the Atlassian's Server API and some features might be unavailable once the add-on is migrated to an external (no-Atlassian) Cloud Server. 

It looks like tempoEpicIssues is no longer supported in OnDemand.... What's the new workaround??? There has to be a supported solution by now, no?

I'm using OnDemand and the tempoEpicIssues() worked (for me) to find all sub-tasks within that epic.

parentEpic worked in bringing in both the Epic and sub tasks of the Epic I needed.


Thank you!

24 votes
Dave Meyer Atlassian Team Jan 12, 2017

13 January 2017

Hi everyone,

As part of the migration of Tempo Timesheets to a new technology platform, the tempoEpicIssues() JQL function is either already removed or will be removed soon (depending on whether your instance has a license for Tempo Timesheets).

However, I'm pleased to announce the parentEpic function is now available in JIRA Cloud as a replacement. Searching with parentEpic will return all the issues in the specified epic(s) AND their sub-tasks. The syntax is a little bit different than a standard JQL functions – it's more like searching with a field. So

project = JRA and parentEpic = JRA-123

will return all issues and sub-tasks in the JRA project that are in the JRA-123 epic. The function also supports the != , IN , and NOT IN operators. So you could also search something like

project = JRA and parentEpic in (JRA-123, JRA-456) 

and you will get all issues and sub-tasks in either the JRA-123 or JRA-456 epics.

Refer to the documentation for more information. Happy searching!

Dave Meyer

Senior Product Manager, JIRA

warning Note: If your JIRA Cloud instance currently has a license for Tempo Timesheets, the tempoEpicIssues() JQL function should still be available. You can manually change your filters to use the parentEpic function, or wait until they are automatically updated as part of the migration to Tempo's new Cloud technology platform

This is perfect Dave - thank you!  This is a drop in replacement for tempoEpicIssues() and needs some up-voting.

I've been using the syntax on Kanban board quick filters to filter by Epic:

"Epic Link" = FOO-123 OR parent in tempoEpicIssues(FOO-123)

The parentEpic function is a direct replacement for the above.  I've just converted all my filters to just:

parentEpic = FOO-123

Thank you!

Related to this, thought you may be the guy to ask. I have kind of the opposite issue when using Agile Boards and Filters.

If I use epics as swim lanes, and use a quick filter by say, Assignee, every sub-ticket gets moved to "Issues Without epics" section, and out of the epic swimlane of its parent, because the parent does not match the filter. We totally lose all organization by epic when this happens, making the swimlane useless. We need the sub-ticket to stay in the epic swimlane of its parent. This is basic stuff we need to make JIRA boards usable. It has been described in bug reports and question pages below. Any input? 

Atlassian question:

JIRA bug: 


Hi Dave,

is this new function available on Server too?


Dave Meyer Atlassian Team Jan 30, 2017

Hi @Jan Scherks. No, not right now.

Works for me!!!  Awesome and thank you!


Works for me. Thanks!

When will this be available in Server?

Looks great, when do you plan to release it for server.

This worked great for me and did exactly what i needed it to do.

This is the most effective solution, thanks!

When is this scheduled to be available for JIRA Server?

Like # people like this
4 votes

A bit late answer, but it might help users resding this in the future :)

The Links Hierarchy add-on can get the full hierarchy in a very simple way:

issue in linksHierarchyIssue('PRJ-1134', 0)

The JQL above will build the full hierarchy tree in memory and will collect all the issues into a flat table, including Epics and Subtasks.

A clear advantage of this add-on is that you can explore the hierarchy for each returned issue in a visual way an understand and verify the results with the fully sincrhonized interactive HTML 5 link viewer.

This JQL returns all issues in the hierarchy in random order. Is there a way to return results that preserve the hierarchial view?

Again, no one using Cloud is helped by this, and is why we need Atlassian to include the basic functionality itself.

This works on JIRA 7+ without requiring a plug-in etc:

"Parent Link" in (childIssuesOf(TEMP-84)) OR "Epic Link" = TEMP-84

I tested this in Jira Server 7.9 and got:

Unable to find JQL function 'childIssuesOf(TEMP-84)'
Like Ben Davolls likes this

This works for me:

"Epic Link" = XXX-### OR parent in issuesWhereEpicIn("key=XXX-###")

This is the only workaround that worked for me on 7.8.0. Thanks!


This is very old question but this may useful to others, this answer work for me but we need to install ScriptRunner plugin to get JQL functions

"Epic Link" = "epicname" OR issueFunction in subtasksOf('"Epic Link" = "epicname"')

It is possible to do with Structure plugin, if you have it installed or don't mind trying. The solution consists of 2 parts: (a) installing synchronizer(s) that will maintain a hierarchy that reflects epic-story-subtasks hierarchy, and (b) using S-JQL to extract portions of the structure (a hierarchy under a specific issue, for example). It requires some setup to get going, but after that it should be easy to work with.

Here's a brief walkthrough to create the structure:

  1. Create a new structure "our structure" and open it (it is empty initially).
  2. Click "Search", click "JQL" small button in the search box, and enter JQL "project = PRJ and type in (Epic, Story)". Turn on "More Issues" button if it is off. Click "Add All" to add all matching issues to the structure. Now you should have all interesting epics and stories in the structure as a flat list.
  3. Use menu Structure | Manage Structure, click on the "Settings" link in the "Sync With" column, and select "GreenHopper". Proceed to entering the parameters. Select project PRJ, turn on "Force Sub-tasks", set "Epic Field" to "Scrum Board Epics", and "Rank Field" to "Don't synchronize".
  4. Proceed to "Resync and Enable" the synchronizer, choose the direction "from GreenHopper to Structure" (sic! it's important to choose the correct direction)
  5. Open structure - you'll see stories arranged under their epics, and having all their sub-tasks under them.

Now you have a structure that represents Epics, Stories and Sub-tasks. Note that moving stories from under one epic to another will also update the epic association (and vice versa), so this structure is live.

Now you're ready to query for issues that belong to certain epic. The JQL for your own example would be this:

issue in structure('our structure', 'ancestor or issue = PRJ-1134')

There are many more variants of S-JQL queries. Please see docs at

The documentation on GreenHopper synchronizer is here:

Hope this helps!

Hi Igor, It works great and i am able to build dasbhboard showing Epic > Story > Subtasks based on filter "Epic link = xxx" Problem : actually Structure is is someway hacking Jira , since by their definition, subtasks are not suppose to have Epic Link field. What happen is when we edit a ticket, Jira will automatically remove Epic Link. Then Structure Synchronizer will put them back again... but not always. Current Workaround : I need to daily Run a Full Resynchronization "Structure > Jira Agile" and warn the team, anytime they edit a ticket, the Epic Link will be back only next morning... Solution : could incremental synchronization be set in direction "Structure > Jira Agile" Unless i am wrong, it seems it's by default "Jira Agile > Structure"

Answering to myself Using : issue in structure('our structure', 'ancestor or issue = PRJ-1134') instead of Epic Link is much more reliable and filter and build dashboard of subtasks based on Epic. Thanks!

Again, no one using Cloud is helped by this, and is why we need Atlassian to include the basic functionality itself.

Like Ben Davolls likes this
Dave Meyer Atlassian Team Jan 23, 2017

Hi @edgar lopez,

See my answer from January 13 – we have just released a native solution to this in JIRA Cloud.

Dave Meyer

Senior Product Manager, JIRA

Here it is, returning both parent and subtasks from epic:

"Epic Link" in (ABC-4820) or parent in havingSubtaskIssuesFromQuery("('Epic Link' in (ABC-4820))")



The first section till "or" returns the parent since all such parents will have linked epic and second part after "or" will only return the subtask of all such parents that are linked to epic.

I am not sure if there is any need to install the script, and to check you can start typing "parent in hav...." if this shows the function "havingSubtaskIssuesFromQuery" you are good to go.

I normally use the following query: parentEpic in (DEMO-1) where DEMO-1 is the issue key

issuetype in (subTaskIssueTypes(),standardIssueTypes()) AND parentEpic = ZSP-1

Whoa, that works.  Thank you!

"parentEpic" isn't either a Jira Server option.

yup... does not work

Looking for Features and Nos of Stories and Nos of Tasks are under it. Any idea?

Jack Brickey Community Leader Oct 15, 2017

@Sudipta Panda,

I see you are new to the Community so I thought I would first let you know that, for future reference, in this case it would be best to start a new thread for your question as this thread is very old and it isn’t clear if your question is precisely the same.

To your question, more info is needed so that the Community can assist. I’m guessing here so please correct me if I’m mistaken. It seems you have an issue type called “Feature” and you want to get a count of the total number of tasks w/in the feature? Or is there some other goal? What do you want to see in the end? A filtered list? A gadget on a dashboard? Is this a one time query or do you want it to be a regular report/gadget?

If you can provide more details I will try to assist further.

After reseraching a lot finally found the following solution

I wanted to create a JQL to show all issues , stories and specially subtasks related to an epic and then have it on the Agile board. The subtask part is what you dont get out of the box
I wanted to do it without any paid plugin like j-trick or Script Runner which can do this very easily

tempoEpicIssues didnt work for me since i am not on OnDemand.

Following is the soluition

1)Install Free SQL for Jira plugin. This is awesome plugin which gives you how to query jira database directly and then used the functionality where you can pass JQL inside a SQL function. The possibilities are unlimited here :)

Then you can do something like this to pull all issues and subtasks. I think we can optimize this more 

project = PROJ AND issue in linkedIssues(PROJ-XXX) OR parent in sql("select key from issues where jql='project = PROJ AND issue in linkedIssues(PROJ-XXX)'") OR "Epic Link" in linkedIssues(PROJ-XXX) ORDER BY Rank ASC

this part was something which you cannot do without a paid plugin

  •      parent in sql("select key from issues where jql='project = PROJ AND issue in linkedIssues(PROJ-XXX)'")

Happy to read SQL for JIRA was useful to resolve this. Do not forget please to rate/review it smile 

This seems very cool, sadly I'm using the OnDemand version and this plugin is not available for that.  Neither is Script Runner, nor any of the other cool plugins that make this work. Does anyone have an alternative for OnDemand?

I am also using OnDemand the seeing: Unable to find JQL function 'tempoEpicIssues(XXX-XXX)'. Reading through the rest of the thread but do not see a workaround without a plugin.  I am part of a very large business with company JIRA Admins who are overwhelmed with the simple administration of JIRA for our company and cannot respond to requests for random plugins.  This seems like a simple query that should be supported OOTB.  Can anyone update?

This is not a solution, this is a hack. 

Like Ben Davolls likes this

I'm also looking for a non-plug-in solution. Did anyone manage to solve this using raw JQL? 

I am looking for a similar solution. I need a query that lists all Storys linked to an epic AND Subtasks of those Storys. Is this not possible? None of the suggestions here work for me. 

Did you ever get a solution?  I'm in the same boat.  I'm trying to create a Dashboard that will show me all Epics and their associated Stories and pertinent information about those stories.  You would think this should be so easy to do but apparently not!  smile

Like Ben Kreischer likes this

I just added a solution and hope it helps 

I want to do the same thing. Did you ever find a solution? I suspect there is none at the moment.

see my answer below (

We looked at purchasing the JQL Tricks plugin ( ) since that has the ability to do advanced JQL... but we never bought it because my users started using labels instead and manually updating labels. There was another plugin that could do advanced JQL queries, but I don't remember what it is. )

0 votes
Jack Brickey Community Leader Mar 26, 2019

I have 'closed' this thread to new replies as it is quite dated and we have an accepted answer to the original question. Please feel free to open a new question should this be desired.

Hi all. Try installing the free add-on AM Utils (not a vendor here... just a user) and use the following query:

issue in issuesSubtasks("'Epic Link' = ABC-4820") or "Epic Link" = ABC-4820

The first part returns all subtasks, the second one all tasks, stories, bugs or others you may have directly connected to the epic.

Works fine here.


This seems pretty simple, but it worked for me:


parentEpic = "Epic-ID"

That captures children of the epic.  But not children of the children of the epic.  If you have a task with subtasks that's in the epic then you'll get just the task and not also the subtasks.  The challenge here is to return all descendants of the epic.

Like Stine Søndergaard likes this

Indeed exists a greater big discrepancy between Server and Cloud. There's no only one solution. And the screenshot posted shows it. @Fernando Valenzuela Jr_ is at cloud. I'm at server and this not work. Ok! Let's finish this: users of cloud has a lot of solutions posted here. Users of server might use (free) AM Utils add-on and a function and perhaps someday the Atlassian Team should unify this solution.

I did what Julio Ferndandes suggested:

* Installed the free [AM Utils Plug-in|]

* Adjusted the filter (Quick filter for the board in my case) to:


issuekey in (issuesSubtasks("'Epic Link' = XXX-11")) OR "Epic Link" = XXX-11



Hope that helps.

linkedIssues() is a built in JQL function.

It searches for issues that are linked to an issue. You can restrict the search to links of a particular type. If the issue is an epic, the search returns all issues and subtasks of that epic. If the issue is not an epic, the search returns all subtasks for the issue.

So if you have an epic link say EXMPL-101, by searching the following in your filter, linkedIssue = EXMPL-101, your filter should should return all of the issues related to that epic and any sub-task of those issues. 

@TCarr I'm not able to use the LinkedIssue. The system doesn't recognize it or I don't have permissions. If it's a permission problem, where would I go to enable that?

I don't believe you need any higher permissions to perform this function. Also, it should be available on both Cloud and Server versions of Jira. 

There may be a problem with the case of your function. The "L" in LinkedIssue should be lowercase (I had originally typed it wrong in the example above, my mistake). Please refer to this page "" for further function details.

Hope that helps! 

Doesn't work for me

I have an

an epic: EPIC-4

an story: TMG-44

and a subtask to my story: TMG-59


I got no result for any of those 3 queries

issue in linkedIssues(EPIC-4)

issue in linkedIssues(TMG-44)

issue in linkedIssues(TMG-59)


I'm using version 7.7 Server

Is there anything I miss?

It won't work.

Im my case (7.3/7.9 Server) I use AM Utils (free add-on) to search all issues and subtasks on it.

A simple example:

issuekey in (issuesSubtasks("'Epic Link' = XXX-99")) ORDER BY Rank ASC

With this I can make boards that swinlanes with stories or projects besides the Epic Link. 

The documentation for linkedIssues() function for server (not cloud) does not mention Sub-tasks.

Advanced searching - functions reference

I believe that the answers should respect the products involved so as not to leave our colleagues in doubt.

hierarchy is not in the box feature in Jira.

most of the answer will work only whether you have scriptrunner plugin installed.

"Epic Link" = XXXX AND issuetype in (Story,"Sub Task")

hi, no this does not meet the requirement.  I need a full listing of all Epics for a version followed by their Stories.  Think 'header/detail report' type of output.



"Epic Link" = XXXX AND issuetype in (Story,"Sub Task") and fixVersion in (***)

Jack Brickey Community Leader Oct 18, 2017

@scherbank, that JQL will not produce the sub-tasks. Since sub-tasks are not directly associated with an Epic they will not show here. The only thing that would show from the above are the Stories associated with the "XXXX" epic link.

Here's how I resolved it without using a plugins (OnDemand instance):


"project in (PROJECT NAME) and issuetype in (Sub-task,Story,bug,Improvement) and parentEpic in (XXX-####) ORDER BY Rank ASC"


This pulls in all issue types related to Epic for a given project.

Hi, I have a similar problem and wondering if anyone can help. I want to add a quick filter that will display all stories that roll up into an initiative. I can get stories that roll up into a specific Epic, but cannot get back stories that roll up into an initiative. Much appreciation.

Maybe it's just a caching issue. I noticed that, since the update, on boards that filter by Epic Link, only newly created subtasks in the epic are shown.

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question


Atlassian Community Events