JQL to get Stories linked to Epics of a specific Initiative

Chander Inguva
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 16, 2017

Is it possible to get all Stories tied to Epic given an Initiative.

 

I was able to get this by two separate queries 

query 1: Using Parent Link = "XYZ" i got Epics linked to an initiative

query 2: Using Epic Link = "ABC" i got stories linked to Epic.

 

How to achieve this in a single query.

P.S: We use Script Runner as well

 

Thank You

Chander

3 answers

2 votes
Chander Inguva
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 17, 2017

Well i figured it out how to get this using Script Runner

 

1. Save a filter which pulls all Epics of an Initiative (level higher than Epic) say "ListOfEpics" (the filter id for below filter was 22323)

issueFunction in hasLinks("is Epic of") AND "Parent Link" = PR-448


2. Using above query as a subquery, i could retrieve all stories involved in Epics

issueFunction in issuesInEpics("filter=22323")


Reference article

 

Hope this helps someone using Script Runner till Atlassian deploys a way to report against grand children for Portfolio issue types.

Feel free to correct my query or any thoughts in improving above method is appreciated.

 

Cheers

Chander

Christopher Heritage
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 26, 2017

Thank you for this! Awesome stuff. Based on your method, we figured out a way to use just one query.

issueFunction in issuesInEpics("'Parent Link' = XXX-##")

where XXX-## is your Initiative issue ID.

Like Michael Pavey likes this
Chander Inguva
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.
June 21, 2017

Glad that it helped you Christopher Heritage.

Cheers

Chander

erika assis July 19, 2021

@Chander Inguva  this was beautiful! 

2. Using above query as a subquery, i could retrieve all stories involved in Epics

issueFunction in issuesInEpics("filter=22323")
0 votes
ALLDATA CM October 14, 2022

Thank you.  This was of great help

0 votes
Povilas Lazauskas February 21, 2021

That helped me.

Taking into account using Script Runner plugin, I actually used like:

issueFunction in issuesInEpics("filter = 'my filter which returns epics'")

I wonder if each filter has it's id, or in your example it was just numeric name of the filter?

filter=22323

Suggest an answer

Log in or Sign up to answer