JQL query for linked issues in a specific project
Asked by Andy Keyworth:

Hi, I have been trying to build a JQL query that can search within a given project, for all linked tickets that are in another project.

For example, we have a DAILY ("Daily Remediation") project, and it can be linked to one-to-many PRO tickets. What I want to build (but haven't been able to) is a query similar to:

project = "Daily Remediation" and status != Closed AND linkedIssues IN linkedIssues("PRO").

I know that won't work, but it's the idea of what I want to define.


Answers:
author: Prosper Agwegiokhe
body: Hi [@Andy Keyworth](/t5/user/viewprofilepage/user-id/5487575) ,

I'm Prosper, a support engineer at Appfire, and I'm here to help you. As [@Trudy Claspill](/t5/user/viewprofilepage/user-id/3569011) as said, you can't achieve the desired result using native Jira advanced search alone.  

If you are open to 3rd party solutions, the app I work for, [JQL Search Extensions for Jira](https://marketplace.atlassian.com/apps/1214791/jql-search-extensions-for-jira-reports?hosting=cloud&tab=overview&utm_source=atlassiancommunity&utm_medium=listinglink&utm_campaign=mauricio), you can use the query below to get the results for your use case:

```
issue in linkedIssuesOfQuery("project in (PRO)") and project = "Daily Remediation" and status != Closed
```

This query will return issues in the project Daily Remediation that have links to project PRO.  

You can see more information about this query [here](https://appfire.atlassian.net/wiki/spaces/JQLSEARCH/pages/604209269/Links+JQL+Functions#LinkedIssuesOfQuery), and please contact our [support](https://appfire.atlassian.net/servicedesk/customer/portal/11) if you have any other questions about this query.

We'll be happy to help you!

Best regards,  
Prosper.

comments: author: Andy Keyworth
body: Thank you Prosper

Personally, I am happy to consider JQL Search Extensions; I just have to rationalize it "upstairs".

Thank you again, I really do appreciate the clarification,

Andy


author: Madhu_RVS
body: Hi [@Andy Keyworth](/t5/user/viewprofilepage/user-id/5487575)

Welcome to the Atlassian community !!

As everyone suggested, if you would like to try out an add-on for this use case, pls take a look at

[Issue Hierarchy](https://marketplace.atlassian.com/apps/1228019/issue-hierarchy-structure?hosting=cloud&tab=overview)

The app shows your issue hierarchy in a tree view created through Issue Links. The Issues in the tree can be in multiple projects and the app will pull out each one of them and show you a structured hierarchy.

The app has multiple other features which are very useful in project tracking and management.

(Disclaimer: I work on RVS, the vendor for this app)

![Links Hierarchy - New.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/346762iCE0355FB1B0DFAC1/image-size/large?v=v2&px=999 "Links Hierarchy - New.PNG")

comments: author: Andy Keyworth
body: Thank you [Madhu](https://community.atlassian.com/t5/user/viewprofilepage/user-id/4651638),

Personally, I am happy to consider Issue Hierarchy; I just have to rationalize it "upstairs".

Thank you again, I really do appreciate the clarification,

Andy


author: Trudy Claspill
body: Hello [@Andy Keyworth](/t5/user/viewprofilepage/user-id/5487575)

Welcome to the Atlassian community.

Jira does not support what you want to do natively. There are third party apps that would support that.

Are you willing to consider a third party app to meet your need?

comments: author: Andy Keyworth
body: Thank you Trudy,

Personally, I am happy to consider a third-party solution; I just have to rationalize it "upstairs".

Thank you again, I really do appreciate the clarification,

Andy


author: Trudy Claspill
body: Besides the apps mentioned by others, [ScriptRunner Enhanced Search](https://marketplace.atlassian.com/apps/1221331/enhanced-search-for-jira-jql-subqueries?hosting=cloud&tab=overview) also has a function that would meet your requirement.


Tags: cloud

jira-cloud