Forums

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

JQL to find all the issues in project A and their parent in project B

Vivek Dixit
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 13, 2021

I have project B that has Initiative and Features issue tickets

I have project A that has as their parent links the Project B tickets.

What I'm trying to bring it in one query is all the issues on the A project and their parents on the B project, could you help me to do that on JQL?

3 answers

1 vote
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 13, 2021

Hi @Vivek Dixit 

I do not believe you can do that with out-of-the-box JQL.  You would need a scripting addon from the marketplace to do so.

If you only need this once, you could manually construct the query by:

  1. export the issues in Project A
  2. parse the keys from the export into a comma-separated value list (keys from Project A)
  3. parse the keys of the parents from the same export into another list (parent keys from Project B)
  4. build a single query

key IN (list from step 2) OR key IN (list from step 3)

 

Best regards,
Bill

0 votes
Radek Dostál
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 16, 2021

With ScriptRunner you make use of 2 good functions:

project = B or (project = A and issueFunction in portfolioParentsOf('project = B'))

// This gets you all issues from project B; AND any issues from project A which are "parent link" from Roadmaps

project = B or (project = A and issueFunction in linkedIssuesOf('project = B'))

// Same deal but with issue links

 

I know there are a few other plugins which allow similar searches or even value regex match (so you could do a pattern match on the parent link value to match your project B's key), but ScriptRunner is simply put the most known one, and the function names are quiet self explanatory for an example.

 

You can't really do this searching with out of box JQL so as others mention, you would need a plugin to allow this or similar queries.

0 votes
Alex Koxaras -Relational-
Community Champion
August 13, 2021

I think what @Bill Sheboy was right. Unfortunately Jira doesn't have this capability. I know there is a suggestion out there somewhere, but I can't find it.

I would trying scriptrunner for this work, but as Bill said, it would require some scripting from your side.

Suggest an answer

Log in or Sign up to answer