The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

JQL to retrieve all jiras linked to Initiative

Renata
August 14, 2020

Hi,

What is the best way to extract all jira's (Epics, Stories) linked to a single initiative?

I have Initiative ABC-111, which is linked to an epic ABC-112 via issuetype 'tracking the backport of'.

Epic ABC-112 is linked back to ABC-111 via issuetype 'backport is tracked by'

Epic ABC-112 has multiple Stories linked via Issues in Epic.

What would the JQL look like? I do not have an option to use childIssuesOf.

The only query I am able to use is issueFunction in linkedIssuesOf.

The JQL query I am using to extract all Epics within an initiative is:

issueFunction in linkedIssuesOf("issuekey = ABC-111","tracking the backport of")

but how do I get all Stories from each one of the Epics?

 

Please help.

Thank you

Renata

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
Ste Wright
Community Champion
August 14, 2020

Hi @Renata 

To confirm:

  • You have an issue type Initiative
  • Epics are linked to Initiatives using issue linking - not the parent hierarchy (i.e you don't have Advanced Roadmaps)
  • Stories are the children of Epics via the Epic Link

It looks like you have ScriptRunner or similar based on your use of issueFunction. If all of this is correct, I'd use:

issueFunction in linkedIssuesOf("issuekey = ABC-111","tracking the backport of") or issueFunction in issuesInEpics("issueFunction in linkedIssuesOf('issuekey = ABC-111','tracking the backport of')")

^ What it does is search for:

  • All issues linked via the linked issue type to your Initiative and...
  • All issues within Epics found via the original search

This is a little more limited than other functions as it targets Epic Link specifically, rather than all other link type possibilities.

Let us know if this works :)

Ste

Renata
August 14, 2020

Thank you so much for the query and your explanation. This is working like a dream.

Like • Ste Wright likes this
1 vote
Sergej Grasmik
August 14, 2020

Hello Renata,

try to use:

issueFunction in linkedIssuesOfAllRecursive("issuekey = ABC-111","tracking the backport of")

Cheers, Sergey

Renata
August 14, 2020

Thank you very much for your time Sergey. Unfortunately, that query has only returned my epics but the query provided by Stephen is working perfectly.

Like • # people like this