Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

JQL to join multiple projects

Dan Spearing
April 27, 2026

Greetings!

I'm using Jira Data Center 10.x. I have 3 projects as shown in the image below. I have access to some functions like parentsOf, portfolioChildrenOf, parentIssuesOf, etc., but IT has control over any Script Runner functions.

I'm trying to create a filter for a Jira Plan (Advanced Roadmaps) for "Project B" that includes all of the issues in "Project B" and ONLY the issues in "Project A" that are parents of issues in "Project B" (See the green boxes in the image). 

I'm going to include "Project B" as a source in my plan. I just need a filter to include just the issues from "Project A" that are parents, or grandparents as shown in the image.

Thanks in advance!

Screenshot 2026-04-27 095256.png

1 answer

1 accepted

2 votes
Answer accepted
Trudy Claspill
Community Champion
April 27, 2026

Hello @Dan Spearing 

Let us first agree on the level numbering.

Natively in Jira the base hierarchy levels are:

Level 1: Epics
|-- Level 0: Standard issue types (i.e. Story, Task, Bug)
|-- Level -1: subtasks

When the hierarchy is customized the levels are number upwards above Epic starting with Level 2; i.e.

Level 3: Theme
|-- Level 2: Initiative
|-- Level 1: Epic

In the hierarchy diagram you provided, how do your levels corresponds to the levels as Jira numbers them?

The native Jira JQL functions cannot get you what you want. You will need to use the Scriptrunner JQL functions.

issuefunction in portfolioParentsOf("project=B") and project=A

That will get you everything in project A at (Jira level numbering) Level 2 and above that is a parent of an Epic in Project B.

That Scriptrunner function does not cross the Story/Epic boundary. If you have Level 0 issues in Project B that are children of Epics in Project A you would need to use this:

issuefunction in epicsOf("project=A") and project=B

Combine those two with an OR.

(issuefunction in portfolioParentsOf("project=B") and project=A) OR (issuefunction in epicsOf("project=A") and project=B)

I don't have a DC environment where I can fully test that out, but based on the documentation it should work.

Dan Spearing
April 27, 2026

 @Trudy Claspill 

Thank you for the response and answer! 

I was already using the "issuefunction in portfolioParentsOf("project=B")" function with incomplete results. However, adding the " and project=A" at the end produced the result I was looking for. I'm not sure why, but I'll take it as a big win.

I've had a hard time finding the documentation for these functions and their usage. I will mark this Answered. But if you can point me in the direction of some documentation, I would be additionally grateful. 

Trudy Claspill
Community Champion
April 27, 2026

Hello @Dan Spearing 

I'm glad that worked for you.

In my previous reply I embedded the link to the portfolioParentsOf() function, but here it is again, plainly pasted.

https://docs.adaptavist.com/sr4js/latest/features/jql-functions/included-jql-functions/portfolio#portfolioparentsof

That links directly to that function. On the left side of the page is a navigation panel that shows headings for other ScriptRunner documentation include documents for other JQL functions they provide.

Suggest an answer

Log in or Sign up to answer