JQL query to retrieve all the epics from multiple capabilities needed

Harihara Prasath V February 27, 2024

JQL query to retrieve all the epics from multiple capabilities needed.  I have a query which can retrieve all the epics from single capability however my need is to create a jql which can retrieve all the epics from multiple capabilities.  Can anyone help?

Query for retrieving epics from single Capability.

project = Key AND issue in linkedIssues(<Capability No.>, "is parent of")

Thanks in advance.

Regards,

Harihara Prasath.

1 answer

1 accepted

0 votes
Answer accepted
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 27, 2024

Hello @Harihara Prasath V 

Welcome to the Atlassian community.

Based on the documentation for the "linkedIssues()" function you must be putting an Issue key into the place where you have "<Capability No.>".

You said you are trying to retrieve Epics. Are you using generic issue linking to link the Epics to the Capability issues? The Capability issues are not child issues under the Epics?

If you are indeed using generic issue linking, then to accomplish your goal you will have to add criteria to your query thus:

project = Key AND (issue in linkedIssues(<Capability No.>, "is parent of") OR issue in linkedIssues(<Capability No.>, "is parent of") OR issue in linkedIssues(<Capability No.>, "is parent of"))

Adding a new OR criteria for each Capability issue.

 

If you have access to third party apps/plugins that extend JQL issue search syntax, then there may be alternatives available. For instance ScriptRunner adds capabilities to find linked issues based on a subquery.

https://docs.adaptavist.com/sr4js/latest/features/jql-functions/included-jql-functions/issue-links#linkedissuesof

Harihara Prasath V February 27, 2024

Thank you Trudy.

Harihara Prasath V February 28, 2024

Thank you Trudy however the above query retrieves the results from the first query only(Though it is not showing any error in the query).

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 28, 2024

You need to substitute your actual issue keys in where I copied your use of <Capability No>

... AND ( issue in linkedissues("ABC-1","is parent of") OR issue in linkedissues("ABC-2", "is parent of") OR issue in linkedissues("ABC-3", "is parent of") )

You will have to repeat the pattern of the OR clauses until you have one for each issue key for your Capability issues.

If that is not giving you the expected results you will need to show us the actual filter you have constructed in order for us to help you debug it.

Harihara Prasath V February 29, 2024

Thank you Trudy.  I missed one closed paranthesis.  It works now.  If we have many capabilities, then we need to input all those capability numbers if we use the above jira query.  Is there any subquery can be used to retrieve without inputing all the capability numbers?

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 29, 2024

There is not another native solution to your requirement.

If you have access to third party apps/plugins that extend JQL issue search syntax, or are willing to obtain one, then there may be alternatives available. For instance ScriptRunner adds capabilities to find linked issues based on a subquery.

https://docs.adaptavist.com/sr4js/latest/features/jql-functions/included-jql-functions/issue-links#linkedissuesof

Suggest an answer

Log in or Sign up to answer