Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Query to find all issues related to an EPIC (including subtasks)

This seems to be one of the most ridiculous problems I have ever encountered. How can it even be hard (let alone impossible) to find all issues related to a specific EPIC without making the ugliest query ever?!

In order to find the epic issue (including its subtasks) along with its epic linked issues and their respective subtasks, I seem to have two alternatives:

Alternative 1

issue = PROJ-1234 OR parent = PROJ-1234 OR "Epic Link" = PROJ-1234 OR issueFunction in subtasksOf("\"Epic Link\"=PROJ-1234")

Alternative 2 (which sucks since this query will also return issues that are linked using other link types)

issue = PROJ-1234 OR issueFunction in linkedIssuesOfAllRecursiveLimited("issue = PROJ-1234", 2)

 

I have gone through every forum thread imaginable and I don't understand why for example "parentEpic" or tempoEpicIssues() doesn't work. I think the former is not available for JIRA server and the latter you need developer permissions for.

 

3 answers

You're right: The parentEpic() function is just on Cloud.

Your Alternative 1 query is almost correct, and it can be slightly improved like this:

key = PROJ-1234 OR "Epic Link" = PROJ-1234 OR issueFunction in subtasksOf("\"Epic Link\"=PROJ-1234")

Alternatively, you may save a filter named 'Epic' with this jql:

"Epic Link" = PROJ-1234

...so that you can use it in a nicer query like:

key = PROJ-1234 OR filter = Epic OR issueFunction in subtasksOf("filter = Epic")

 

Hi Ignacio,

How is "key" different from "issue"? It returns the same result, right?

Kindly,

Tobias

0 votes
Ignacio Pulgar Community Leader Aug 21, 2018

Yup, it's the same than issue but shorter, which is specially good for long queries... hehe.

Using JIRA v7.7.0 - no addins...

Type this into Advanced Search

issue = BIT-1230 OR parent = BIT-1230 OR "Epic Link" = BIT-1230 OR issueFunction in subtasksOf("\"Epic Link\"=BIT-1230")

Received this response...

Field 'issueFunction' does not exist or you do not have permission to view it.

What am I missing?

Ignacio Pulgar Community Leader Nov 21, 2019

You need to count with ScriptRunner addon installed in your Jira instance for being able to use issueFunction.

Is there a way to do this without having a plugin installed?

Ignacio Pulgar Community Leader Nov 23, 2019

Hi Jason. I'm afraid there's no JQL way in Jira Server to get the subtasks of issues that belong to the specified epic without the help of a plugin.

Of course, there would be ways for getting them through SQL, by querying directly against the database, but that's usually considered a bad practice...

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you