JQL to show all issues AND subtasks in the Epic

Nathan June 5, 2013

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
Lisa Schaffer December 11, 2016

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.

Mike Doolittle December 20, 2016

BOOM! Thanks Lisa!

Like # people like this
Dale Bradman June 26, 2017

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
scherbank October 3, 2017

This works only when you have scriptrunner plugin installed

Like # people like this
Junio Fernandes February 20, 2018

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
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 22, 2018

instead of parent use parentEpic = XX-##

 

This works in Cloud without any plugins. 

Like # people like this
Dave Campbell June 26, 2018

This works in Cloud without plugins for me too.

Thanks Lisa!

ian.brown July 18, 2018

Thanks for this

sylvain dupuy August 1, 2018

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")

Sylvain

Like # people like this
Junio Fernandes August 1, 2018

@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
Jitendra Khatri August 1, 2018

Hi @Junio Fernandes,

Did you tried this?

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

 

Explanation:

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
Junio Fernandes August 2, 2018

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 October 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 Deleted user likes this
Mark Klein January 3, 2019

Chris,

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
Carlos Hidalgo January 30, 2019

Great! Thanks Lisa

Harsha Vardhan March 20, 2019

I am just trying to create a report - 

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

Basically

Epic 1 

User story 1

User story 2

Epic 2 

User story 3

User story 4

Like # people like this
Junio Fernandes March 21, 2019

@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
53 votes
Answer accepted
Saikat Paul December 27, 2013

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-###")

Chad Wight January 6, 2014

brilliant!!

Like # people like this
Jean-Marc Raymond July 2, 2014

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

Like Tim Malone likes this
Stefan
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.
July 30, 2014

Doesn't work for OnDemand...

Pablo Beltran
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.
July 30, 2014

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]

Like # people like this
Santosh Maurya January 24, 2017

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

Robert M July 5, 2017

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
Junio Fernandes November 29, 2017

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
Marianne Miller
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.
May 24, 2018

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

Michael Benz June 19, 2018

Easy solution with localized German Epic Links ;-)

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

 

Like # people like this
Chris O_Brien September 7, 2018

@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?

Junio Fernandes September 10, 2018

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
Alexander February 21, 2019

Thanks Saikat!!!

38 votes
Erik Hess March 12, 2014

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-####)

Angell March 25, 2014

Sweet, that definitely worked for me, specifically

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

pulls in all subtasks for a specific epic.

Raju Adluru
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.
May 21, 2014

Hi

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.

thanks

Adam Smith July 10, 2014

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

Jane Sherman May 15, 2015

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

Matthew Wallace October 13, 2015

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

Pablo Beltran
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.
February 7, 2016

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. 

Alan Fitzgerald February 26, 2016

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?

MarcelW March 22, 2016

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

Ahmed Alameddine October 18, 2018

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

 

Thank you!

24 votes
Dave Meyer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 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

Patrick N Van Staveren January 20, 2017

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!

edgar lopez January 23, 2017

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:

https://answers.atlassian.com/questions/39988150


JIRA bug:
https://jira.atlassian.com/browse/JSW-10683 

 

Jan Scherks January 30, 2017

Hi Dave,

is this new function available on Server too?

Thanks

Dave Meyer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 30, 2017

Hi @Jan Scherks. No, not right now.

Aaron Pickrell February 22, 2017

Works for me!!!  Awesome and thank you!

 

Jakob Bagterp March 20, 2017

Works for me. Thanks!

rebecca_dev May 23, 2017

When will this be available in Server?

Stéphane Lapierre February 19, 2018

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

Kristi May 17, 2018

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

Paolone October 16, 2018

This is the most effective solution, thanks!

mspurling December 13, 2018

When is this scheduled to be available for JIRA Server?

Like # people like this
4 votes
Kinto Soft
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.
January 7, 2014

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.


Lori Cobb April 17, 2014

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

edgar lopez January 23, 2017

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

3 votes
Andrew_Vella May 9, 2018

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

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

Junio Fernandes May 10, 2018

I tested this in Jira Server 7.9 and got:

Unable to find JQL function 'childIssuesOf(TEMP-84)'
Like Ben Davolls likes this
3 votes
Matthew Nichols August 21, 2015

This works for me:

"Epic Link" = XXX-### OR parent in issuesWhereEpicIn("key=XXX-###")
Carsten H May 24, 2018

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

2 votes
Tej March 16, 2017

Hi,

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"')

2 votes
Igor Sereda [ALM Works]
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.
July 22, 2013

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 https://wiki.almworks.com/x/coPE

The documentation on GreenHopper synchronizer is here: https://wiki.almworks.com/x/mwBg

Hope this helps!
Igor

Jacques Chatenet July 2, 2015

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"

Jacques Chatenet July 7, 2015

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!

edgar lopez January 23, 2017

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
Atlassian Team members are employees working across the company in a wide variety of roles.
January 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

1 vote
Jitendra Khatri June 20, 2018

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

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

 

Explanation:

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.

1 vote
Bart van Houdt June 15, 2018

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

1 vote
davidsmith_swk November 9, 2017

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

Ryan Porter December 20, 2017

Whoa, that works.  Thank you!

Junio Fernandes May 10, 2018

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

JoernBerkefeld October 19, 2018

yup... does not work

1 vote
Sudipta Panda October 14, 2017

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

Jack Brickey
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 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.

1 vote
prajwal4u
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 3, 2016

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 :)
https://marketplace.atlassian.com/plugins/com.kintosot.jira.jdbc4jql/server/overview

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)'")
Pablo Beltran
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.
May 3, 2016

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

Juan Tellez August 3, 2016

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?

Julia Lavaroni August 4, 2016

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?

Benjamin Herron November 11, 2016

This is not a solution, this is a hack. 

Like Ben Davolls likes this
1 vote
Dale Bradman February 7, 2016

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

1 vote
Bryan Cook October 5, 2015

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. 

Janelle Lirette February 16, 2016

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
prajwal4u
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 3, 2016

I just added a solution and hope it helps 

1 vote
Rasmus Luckow-Nielsen July 22, 2013

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

Nathan July 22, 2013

see my answer below (

We looked at purchasing the JQL Tricks plugin ( https://marketplace.atlassian.com/plugins/com.j-tricks.jql-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
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 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.

0 votes
Richard July 5, 2018

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.

Cheers!

0 votes
Fernando Valenzuela Jr. May 18, 2018

This seems pretty simple, but it worked for me:

 

parentEpic = "Epic-ID"

Ryan Porter May 18, 2018

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
Fernando Valenzuela Jr. May 18, 2018

Children of children.jpg

Junio Fernandes May 18, 2018

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.

0 votes
Andreas Profous May 11, 2018

I did what Julio Ferndandes suggested:

* Installed the free [AM Utils Plug-in|https://marketplace.atlassian.com/apps/1211565/am-utils?hosting=server&tab=overview]

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

{noformat}

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

{noformat}

 

Hope that helps.

0 votes
TCarr January 9, 2018

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. 

davidsmith_swk January 18, 2018

@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?

TCarr January 18, 2018

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 "https://confluence.atlassian.com/jiracorecloud/advanced-searching-functions-reference-765593719.html" for further function details.

Hope that helps! 

Stéphane Lapierre February 20, 2018

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?

Junio Fernandes May 10, 2018

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. 

Junio Fernandes May 10, 2018

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.

0 votes
scherbank October 3, 2017

hierarchy is not in the box feature in Jira.

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

0 votes
Yugank Bhatnagar July 19, 2017

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

Janelle Lirette July 19, 2017

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.

 

thanks,

scherbank October 16, 2017

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

Jack Brickey
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 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.

0 votes
Carlos Anchia June 19, 2017

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.

0 votes
Alexander Gertsen November 9, 2016

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.

0 votes
Efraim Bart September 29, 2016

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