How to retrieve a list of issues in a project linked with other projects
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
This page explains how to retrieve issues from Cross-referenced projects, such as listing their linked issues from different projects.
Environment
Jira Data Center 8.x and 9.x.
Solution
You can not list linked issues from multiple projects using Jira's native JQL. However, you can get the details from Jira Database or using some third-party apps like ScriptRunner for Jira :
Run the below SQL in Jira Database to get the list of issues in a given project that is linked with other projects:
This was written and tested using a PostgreSQL DB, for other database types you may need to tweak it depending on the database you are using.
1
2
3
4
5
6
7
8
9
10
11
select
PJ1.pkey as SrcProjName,
PJ2.pkey as DestProjName,
PJ1.pkey || '-' ||ji1.issuenum as IssueID
from issuelink ILINK
inner join jiraissue JI1 on ILINK.source = JI1.id
inner join jiraissue JI2 on ILINK.destination = JI2.id
inner join project PJ1 on JI1.project = PJ1.id
inner join project PJ2 on JI2.project = PJ2.id
where PJ1.pkey != PJ2.pkey
order by SrcProjName;
You can also use ScriptRunner Jira Query Language (JQL) functions issueFunction and linkedIssuesOf to get the desired search result. The JQL query format would look like this:
1
project = "YourProjectKey" AND issueFunction in linkedIssuesOf("project != 'YourProjectKey'")
Was this helpful?