Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

JQL: How to get all the Epics for a given set of Stories

Mick Gibson July 10, 2024

Hi Folks,

Firstly, I'm hoping this can be done in JQL - without ScriptRunner or via Automation.

Also, we have the JQL Tricks plugin, but not any of the other 3rd party plugins, so I can't use 'IssueFunction' to solve this problem.

 

Can someone help me craft some JQL that returns all the Epics (i.e. multiple) related to a set of stories (again, multiple) that I identify through another query.

 

Note: this all needs to be in one piece of JQL because it's intended to feed a board.

 

To help, I'll use a simpler example than my actual use-case, but could someone help me write JQL that can return all the Epics for all the child stories someone is assigned to?  I could then adapt it to what I need...

 

I've spent a couple of hours searching (both Google and this community forum) and trying various combinations of syntax, but can't get it to work.

 

Thanks in advance - Mick

1 answer

0 votes
Valerie Knapp
Community Champion
July 10, 2024

Hi @Mick Gibson , thanks for your question. 

You could start by isolating the Stories that have Epics connected to them -

project = (your project key) AND type = Story and parent IS NOT EMPTY ORDER BY parent ASC

Then, in the search results, I added the parent column so you can sort and start to see, at least visually which and how many Epics are linked to Stories.

Screenshot_20240711-063647.pngThen, you could run the same queries but with Parent in or Parent= to get the list of Stories just for one or a shorter list of Epics.

project = (your project key) AND type = Story and parent IN (epic 1, epic 2, etc)

I hope this helps but if not, or if you have other feedback or questions, please reply here and either I or someone else will try to help. 

Cheers

Mick Gibson July 10, 2024

I probably should have added that this all needs to be one piece of JQL so I can use it as a query to populate a Board.

 

I'll update the original post

Like John Funk likes this
John Funk
Community Champion
July 11, 2024

You will not be able to do that with out an add-on, like ScriptRunner. 

Mick Gibson July 11, 2024

That's where my research led me, but thanks for confirming.

Like John Funk likes this

Suggest an answer

Log in or Sign up to answer