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!
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-###")
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.
Hi Nathan,I have been trying to get results based of 1 single JQL, but I'm afraid this simply is not possible. Could you explain what exactly it is you are trying to accomplish, perhaps there is another solution.
I have a Greenhopper board and I want all tasks and subtasks for each of my epics to show up in an epic swimlane (one swimlane per epic).
So... I created a swimlane called "Build Foobar" and I have an epic called "Build Foobar" that has issue key of PRJ-1134. I was hoping to get all issues to show up in the "Build Foobar" swimlane (easy peasy) AND all those issues' subtasks (pain).
I know I can do this with labels... but I was trying to avoid creating labels since it requires my developers to use the right label everytime they create a subtask to an issue.
I want to do the same thing. Did you ever find a solution? I suspect there is none at the moment.
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:
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
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. )
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.
Nathan,
I use the Craftware plugin Search Linked Issues for JIRA and do that query like this:
("Epic Link" = CP-32236 OR issue IN subtaskIssuesFromQuery("cf[11960]=CP-32236"))
Where cf[11960] is the id of my Epic Link field.
Just as your users are, my users are building labels or issue links back to the epic to help find things but hopefully i'll be able to show them ways to save time as we get used to these capabilities.
There is no need for any Plugin..
Switch to "advance" filter option and enter
status in ("Open") AND parent in (PHX-xxx,ENG-xxx)
It will give you all the open tickets present as a subtask in parent JIRAS. Build more complex and enjoy using JIRA. Advance filter options will also give you all possible values to build Queries.
Please comment if its helpful.
Regards.
Hassan Saleem
Quality Control Engineer
Wellogic. U.A.E
Hassan, I think the ask was to isolate all issues and the subtasks of the issues associated to the epic, not just the issues and subtasks associated to the epic. Your example neglects to include the subtasks associated to the issues..
brilliant!!
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.
Anyone else find out an answer to accomplish this in JQL?
I did run into the Links Hierarchy plug-in (which looks rad), but looking for a non-plug-in solution at the moment.
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.
This JQL returns all issues in the hierarchy in random order. Is there a way to return results that preserve the hierarchial view?
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
Raj, the Epic link can't equal multiple values (each issue is in one Epic), but you can return issues in one of many Epics. e.g., "Epic Link" in (TEST-1275,TEST-955,TEST-966)
Erik
Thanks that worked well, appreciate your help.
Thanks Saikat. That works great, and without having to purchase a plugin.
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
Doesn't work for OnDemand...
I have an epic containing about 20 issues, but the JQL parent = XXX-1234 returns nothing at all.
parent = XXX-1234
yeah, you're dealing with the same thing i am i believe. there is a different between 'linked issues' and 'issues in epic'. to return the linked issues, try...
issue in (linkedIssues(AAA-###))
BUT for all the 'issues in epic'... i've yet to find a string that returns those issues.
then again, looks like i found a way to show them all. issue in (ABC-123, linkedIssues(ABC-123)) OR "Epic Link" = ABC-123 this will show all linked issues, issues in epic and even return the parent epic in the list as well. i use this for a confluence page.
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!
This works for me:
"Epic Link" = XXX-### OR parent in issuesWhereEpicIn("key=XXX-###")
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.
I'm also looking for a non-plug-in solution. Did anyone manage to solve this using raw JQL?
Nearly... Doesn't return sub-tasks of stories however.
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!
Also try:
"Epic Link" =<Epic ID> AND issuetype in (Story, Sub-task) OR issuekey in tempoEpicIssues(<Epic ID>) ORDER BY Rank
I'm getting the following error when trying this:
project = "xxx xxx" AND "Epic Link" = xxxx-### AND issuekey in tempoEpicIssues(xxxx-###)
Error: Unable to find JQL function 'tempoEpicIssues(xxxx-###)'.
Note: xxx=actual text I'm trying to query for but left out for privacy reasons
Hi Janelle
I have modified the sql :
Here is what I have in my filter:
"Epic Link" = RSYS-550 AND issuetype in (Story, Sub-task) OR issuekey in tempoEpicIssues(RSYS-550) ORDER BY Rank
and I'm receiving the same 'unable to find JQL function 'tempoEpicIssues..."
Is JQL function standard with Jira?
thanks for all of the help,
Janelle
No doubt things change along the time, and today, there are new plugins able to resolve it in the wink of an eye, like SQL for JIRA. It transforms any JQL into a SQL.
Not only that. It is also able to summarize regular and custom issue fields, create visual reports, etc. f course, and transform SQL into JQL again. So you are able to resolve ANY report like this and surely anything you could imagine.
I am still looking for an solution to use with OnDamand.
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 boxI 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
I just added a solution and hope it helps
Happy to read SQL for JIRA was useful to resolve this. Do not forget please to rate/review it
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?
@Alan Fitzgerald it Looks like in the latest version of JIRA (7.2.1 specifically) Epic Link now includes subtasks as well, I'm still looking for official confirmation of that though.
The OnDemand version (not sure the version) still doesn't support it today.
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.
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.
BOOM! Thanks Lisa!
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).
tempoEpicIssues()
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
parentEpic
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
!= , IN , and NOT IN
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
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
Again, no one using Cloud is helped by this, and is why we need Atlassian to include the basic functionality itself.
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
Hi Dave,
is this new function available on Server too?
Thanks
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"')
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.
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?
"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.
thanks,
This works only when you have scriptrunner plugin installed
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") and fixVersion in (***)
@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.
This is the only workaround that worked for me on 7.8.0. Thanks!
It looks like you're new here. Sign in or register to get started.