"How can I write a JQL query to select all stories and tasks that have a given epic link as well as all sub-tasks of tasks or stories that have a given epic link?"
The first part is easy ...
project = INFRA AND "Epic Link" = Databases ORDER BY Rank ASC
... it's the second part that is the real puzzler.
Let me start by saying that I've spent quite while Googling on this question already and all the supposed solutions that I've seen require the use of addons. I want to find a solution to the above that DOES NOT require an addon. I think it's a perfectly reasonable to want to create a view (board or whatever) that includes all the items that are hierarchically structured under a given higher level object in the Jira object model. I sincerely hope that this is possible given the base-level capabilities of JQL.
How can I do this?
Aha! parentEpic wants the epic key not the epic name!!! That's intuitive. So this works ...
parentEpic = INFRA-5
So this actually does what I want ...
project = INFRA AND ("Epic Link" = Databases OR parentEpic = INFRA-5) ORDER BY Rank ASC
Or more specifically this ...
project = INFRA AND ("Epic Link" = Databases OR (parentEpic = INFRA-5 AND key != INFRA-5)) ORDER BY Rank ASC
... since the first query returns the epic itself. The second query returns just the stories, tasks and sub-tasks.
Actually, the "Epic Link" condition is now redundant. These two queries return the same issues ...
project = INFRA AND ("Epic Link" = Databases OR (parentEpic = INFRA-5 AND key != INFRA-5)) ORDER BY Rank ASC
project = INFRA AND parentEpic = INFRA-5 AND key != INFRA-5 ORDER BY Rank ASC
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @adavies - Welcome to the Atlassian Community!
You will need an add-on such as ScriptRunner to be able to get the sub-tasks. See this link for some more information:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I refer the honorable gentleman to this quote from my original question ...
"I want to find a solution to the above that DOES NOT require an addon"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have found references to a JQL function called "parentEpic" ...
https://support.atlassian.com/jira-software-cloud/docs/advanced-search-reference-jql-functions/
The examples on that page seem to suggest that this would work ...
Find issues and sub-tasks in the epic DEMO-123:
parentEpic = Databases
but when I use that in my Jira instance I get this error ...
"The issue key 'Databases' for field 'parentEpic' is invalid."
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.