Dynamic JQL Query to Retrieve Linked Initiatives from other Projects in Jira Plan

Chris K
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.
August 14, 2024

Dear Atlassian Community,

 

We are currently working with Jira Plans using different board filters as issue sources. Specifically, we are pulling in a selection of issues from Project "A," including Initiatives, Epics, and Tasks.

 

However, we are facing a challenge:

Some Epics in Project A are linked (via the Parent Link field) to Initiatives that are part of other Jira projects. These Initiatives do not appear on the Roadmap because the filters only include issues from Project A and we are facing unassigned Epics in the Roadmap.

 

Our goal is to create a JQL query that dynamically retrieves all Initiatives from the other projects that are linked to Epics within Project A.

 

We've tried different approaches using the linkedIssues function in JQL, but failed. We would appreciate any guidance on how to construct a dynamic JQL query (preferably using ScriptRunner or another method) to achieve this. Our ideal outcome is to have the Roadmap display all relevant Initiatives from other projects that are linked to Epics from Project A.

 

Thank you in advance for your help!

 

Best regards,

Chris

2 answers

1 accepted

1 vote
Answer accepted
Florian Bonniec
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 14, 2024

Hi @Chris K 

 

You could use the following function portfolioParentsOf

issueFunction in portfolioParentsOf("project = A and type = Epic") and type = Initiative

But in order to work with AR, I recommand to add filterring on the projects you are expecting to have Initiatives, otherwise you will reach the 100 project limit of AR.

Regards

Chris K
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.
August 15, 2024

Hi @Florian Bonniec 

Thank you for your quick response. This solution works just perfectly for our use case! :)

 

Kind regards,

Chris

Like Florian Bonniec likes this
0 votes
Prosper Agwegiokhe
Contributor
August 14, 2024

Hi @Chris K ,

I’m Prosper, a support engineer at Appfire, and I’m here to help you.
Unfortunately natively, you’ll not be able to do it dynamically.

In the app where my team works, JQL Search Extensions for Jira, you can use this query, to find the initiatives in the project A:

issue in parentsOfIssuesInQuery("project='A' and type=Epic")

Or use this query below to get the initiative linked to epics in project A:

issue in linkedIssuesOfQuery("project='A' and type=Epic") and type = Initiative

Please contact our support if you have any other questions about this query.

We’ll be happy to help you!

Best regards,
Prosper.

Chris K
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.
August 15, 2024

Hi @Prosper Agwegiokhe

Thank you for your help! The provided solution by @Florian Bonniec solved the case for us, therefore we won't need the add-on. Thank you! :)

 

Kind regards,

Chris

Like Prosper Agwegiokhe likes this

Suggest an answer

Log in or Sign up to answer