Forums

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

JQL Query Needed

Robert June 1, 2023

I need a query that returns issues from Project A and issues from Project B whose parent is in Project A.  

Something like:

Project = A OR (Project = B and Parent = Project A)

This would make tracking and planning related issues across projects easier.


Can this be done "out of the box" with JQL or is a third-party plug-in needed?

2 answers

2 accepted

1 vote
Answer accepted
Trudy Claspill
Community Champion
June 1, 2023

Hello @Robert ,

That type of JQL is not available out of the box. It might be able to be achieved with a third party app. 

How are you establishing that one issue is the parent of another? I see that your post is tagged to indicate you are using the Premium plan. Are you creating the parent/child relationships though an Advanced Roadmap Plan?

Robert June 1, 2023

So what I have are epics and stories in my project and some stories for that epic are in other projects. 

It would be easier to have a filter that pulls all of those stories into a single view, such as in Advanced Road Maps. Right now to make those stories in other projects visible is to use labels, fix versions, or components, but things get missed when tagging.  

Trudy Claspill
Community Champion
June 1, 2023

Without a third party app they only way to accomplish this is the manner you already use - updating another field to indicate the parent Epic is in a different project.

You could use an Automation rule to manage the setting of that field rather than relying on a person to set it.

You could create a rule that is triggered by an issue update and check to see if the Epic Link field was changed. Depending on how that field was changed and what value it had before and after the change you could update another field that could be used in your filter to determine that the child issue in Project B was a child of an Epic in Project A.

0 votes
Answer accepted
Hannes Obweger - JXL for Jira
Atlassian Partner
June 1, 2023

Hi @Robert,

as already suggested, this is trickier than one would think; as a "hierarchical query", it would really require some kind of "join" or "subquery", which isn't available in plain JQL. To the best of my knowledge, you'll need extra tooling for this. 

A few directions forward:

  • You should be able to use Jira Automation to "propagate" an epic's project down to the epic's children, and then use the respective field on the children to include them into your query.
  • There's different apps from the Atlassian Marketplace that can help with that. First, there's a number of apps that extend JQL by additional functions, including hierarchy-related functions. I've used JQL Search Extensions a few times and it works great.
  • Alternatively, you could try one of the more hierarchy-focused apps from the Marketplace. These apps typically have their own ways of figuring out parent/child relationships between issues, and provide more powerful ways to define and search 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

Hannes Obweger - JXL for Jira
Atlassian Partner
June 1, 2023

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. Put simply, you'd pull in the epics of project A, as well as any potential child stories from project A and project B, enable the default hierarchy (that's just one click), and hide any issues that are outside of your hierarchy (that's another 2 clicks):

issues-from-parents-of-project.gif

Once you have your list of issues, you can work on these 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!

Robert June 1, 2023

Thanks for the info.  JXL looks interesting.  I don't think I will be able to get any funding for add-ins. I will have to opt for Automation.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events