Hi guys!, I'd need to find a queryr in order to include in a Plans filter
Asked by Nieves Garc?a:

for finding all Epics (from differents Jira projects) but with value of "Parent link", Initiatives of an unique Project.


Answers:
author: mauricio.groth
body: **Hi [@Nieves Garc?a](/t5/user/viewprofilepage/user-id/5191177)**

I'm Maur?cio, a support engineer at Appfire and I'm here to help you.

Unfortunately, using JQL of Jira, you'll not be able to do it dynamically.

In the app where my team works, [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 this query to find all the Epics which the 'Parent link' is an initiative of the project MT-Feel.

```
issue in childrenOfIssuesInQuery("project='MJP' and type=Initiative") and type=epic
```

Please contact our [support](https://jqlsearchextensions.atlassian.net/servicedesk/customer/portal/2) if you have any other questions about this query.

We'll be happy to help you!

Best regards,  
Maur?cio

comments: author: Nieves Garc?a
body: Hi [@mauricio.groth](/t5/user/viewprofilepage/user-id/4891303) !, Thanks in advance for your support.

Let me share with you that I found a solution , using the function,

LinkedIssuesofrecursive(subquery, \[link name..\])

In my case, issueFunction in linkedIssuesOfRecursive("project = MTFEEL", "is parent of")

Thanks \& best regards,


author: Hannes Obweger - JXL for Jira
body: Hi [@Nieves Garc?a](/t5/user/viewprofilepage/user-id/5191177)

unfortunately, this is trickier than one might think; as a "hierarchical query", it would really require some kind of "join" or "subquery", which isn't available in plain Jira/JQL.

A few directions forward:

* If it's a one-off thing, you could first query the relevant initiatives, and then use the keys of these initiatives in a second query, in an ""Parent link" in (KEY-1, KEY-2, ...)" clause.

If you want to run your search "dynamically", without manually "stitching" two queries together, you'll need extra tooling:

* You might be able to use [Jira Automation](https://www.atlassian.com/software/jira/features/automation) to "propagate" initiative information down to the epics, and then use the respective field(s) on the epics to include them into your filter. Obviously, this will add a fair bit of complexity to your system.
* There's different apps from the [Atlassian Marketplace](https://marketplace.atlassian.com/) that can help with that. First, there's a number of apps that [extend JQL](https://marketplace.atlassian.com/search?query=jql) by additional functions, including hierarchy-related functions. I've used JQL Search Extensions a few times and it works well.
* Alternatively, you could try one of the more [hierarchy-focused](https://marketplace.atlassian.com/search?query=hierarchy) apps from the Marketplace. These apps typically have their own ways of figuring out parent/child relationships between issues, and provide more powerful ways of searching through issue hierarchies. I myself work on such an app, in which your use case would be easy to solve - I'll provide more details below.

Hope this helps,

Best,

Hannes

comments: author: Hannes Obweger - JXL for Jira
body: Just to expand on the last point, this is how this would look in the app that my team and I are working on, [JXL for Jira](https://marketplace.atlassian.com/apps/1224710?hosting=cloud&tab=overview&utm_source=atlassian-community&utm_medium=referral&utm_content=2326081). Put simply, you create a sheet with all your relevant initiatives and any *potential*epics below these initiatives. You then configure your hierarchy (that's just a couple of clicks) and hide all issues that exist "outside" of this hierarchy:

![initiatives-of-certain-project.gif](https://community.atlassian.com/t5/image/serverpage/image-id/250601i7146BF5B00512364/image-size/large?v=v2&px=999 "initiatives-of-certain-project.gif")

Once you have your set of issues, you can work on these issues directly in JXL (much like you'd do in e.g. Excel or Google Sheets), trigger various operations in Jira, or export them for further processing.

Any questions just let me know!


author: Nieves Garc?a
body: Hi [@Hannes Obweger - JXL for Jira](/t5/user/viewprofilepage/user-id/4289506) ,

Firstly, thanks for sharing all of those alternatives. Great help for me!

What a pity!, I'd need showing up all the Epics which 'Parent link' is a initiatives of the project M-Feel.

I mean, you guy know, showing in a Plans all the initiatives of MT-Feel project and in cascade with their epics (whatever project belong)

I thought that exists some Jira functions for that,( e.g linkedIssues(), epicsOf(),...) which could answer if its project parent link is MT-Feel or something like that... :(

Kind regards!


author: Hannes Obweger - JXL for Jira
body: [@Nieves Garc?a](/t5/user/viewprofilepage/user-id/5191177) yeah understood - I believe you should be able to do this with a Marketplace app.

Another thing I could think of is to create a Advanced Roadmaps plan with two filters: One filter that pulls in all your initiatives from MT-Feel, and another filter that pulls in any *potential* epics (from any projects you generally care about). Advanced Roadmaps should then show the epics under their initiatives, and all other epics in a special "Issue without parents" bucket that you can just ignore.

This is similar to how it would be done in JXL, except that JXL has an option to completely hide any "issues without parents".


author: Nieves Garc?a
body: Hi [@Hannes Obweger - JXL for Jira](/t5/user/viewprofilepage/user-id/4289506) , thanks a lot for your ideas and comments. It was great help for me. Finally, I found a solution , this is using the Function,

LinkedIssuesofrecursive(subquery, \[link name..\]),

this function traverses issue links recursively to return **all** issues that are linked (directly and indirectly) to the results of the initial subquery.

In my case : issueFunction in linkedIssuesOfRecursive("project = MTFEEL", "is parent of")

Thks \& Best Regards,


author: Javad Farahani
body: To find all Epics from different Jira projects with a specific value for the "Parent link" field, linked to Initiatives of a specific project, you can use the following JQL query:

java  
Copy code  
project in (\<project1\>, \<project2\>, ...) AND issuetype = Epic AND "Parent link" in (project = \<initiatives_project\>) AND "Parent link".issuetype = Initiative  
Make sure to replace \<project1\>, \<project2\>, ... with the project keys of the Jira projects where you want to search for Epics, and \<initiatives_project\> with the project key of the project where Initiatives are stored.

This query will search for all Epics in the specified projects that are linked to Initiatives in the \<initiatives_project\> project via the "Parent link" field.

You can save this query as a filter in Jira and use it as a basis for your Plans filter. Note that the Initiatives project should also be added to your Plan in order to use this filter.

comments: author: Nieves Garc?a
body: Hi Javad, thanks a lot for your answer. But let me explain in more details what I need,

I have a 'jira project', MT-Feel, with Initiatives and epics included under them. But, those epics can belong others jira projects that for starting I don't which are...

I mean, I'd need to show all Initiatives of jira project (MT-Feel) with its Epics included whatever project belongs (not only from MT-Feel).

Thanks in advance!,


Tags: advanced-roadmaps