It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Query to find all initiatives with child issues in a set of projects?

I'm attempting to craft a query to get a list of all Initiatives that contain Epics in 2 specific projects. 

I've installed the trial version of JQL Search Extensions am experimenting with subqueries but I'm not quite there yet. 

If I have a subquery, call it MyEpics: 

issuetype = Epic AND (project = "A" OR project = "B")

how do I then use that to get something on the order of

issuetype = Initiative AND subtasks in MyEpics

 

2 answers

If i correctly understand you are using JQL Search Extensions for Jira & reports plugin 

 

you can try following example and it will work in your scenario. In your case you need to replace issuetype from bug to Epic

 

Nested queries 

You can use the new JQL keywords together, for instance 

Example

linkedByQuery= "subTaskOfQuery = project = DEMO and issuetype = Bug

The query above finds all issues which are linked by the subtasks of the bugs in the project demo. In order for this functionality to work, please first:

  1. Define a subquery: project = DEMO and issuetype = Bug
  2. Define another subquery that uses the first subquery: subTaskOfQuery = project = DEMO and issuetype = Bug

This will allow using subTaskOfQuery = project = DEMO and issuetype = Bug together with all the new JQL keywords. 

 

https://jqlsearchextensions.atlassian.net/wiki/spaces/SEARCH/pages/173211649/Subqueries+-+Jira+Cloud#Subqueries-JiraCloud-issuesFromEpicsInQuery

Hi Muhammad. I've read this document and am still not getting the query right. Here's what I have thus far:

I have a subquery I've aliased "MobileEpics" that is

issuetype = Epic AND (project = "Mobile: Android" OR project = "Mobile: iOS")

If I run 

issuesInQuery="mobileEpics"

I get what I expect, a list of all the Epics in both projects. However, this query returns no results:

parentOfQuery="mobileEpics"

I expected to get a list of the Initiatives that are parents of the Epics?

could you please explain this line?

 

I expected to get a list of the Initiatives that are parents of the Epics?

 

I am lost now, this line giving me another understanding.

My goal is a list of Initiatives that have children Epics in 2 projects. We have put most of our Initiatives in 1 project and the Epics are spread out in many projects. 

Does that clarify the question?

Hi Janene, that's because parentOfQuery is only meant to be used with subtasks and their parents. Portfolio relationships are not supported.

I'm now attempting this with ScriptRunner instead. I'm using this: 

 issueFunction in parentsOf("(project = AN OR project = IOS) AND issuetype = Epic")

and it is returning no issues. I'm beginning to suspect that "parentOf" isn't set up properly for Initiatives with Epics as subtasks ?

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Jira

Demo Den Ep. 7: New Jira Cloud Reports

Learn how to use two new reports for next-gen projects in Jira Cloud:  Cumulative flow diagram and Sprint burndown chart. Ivan Teong, Product Manager, Jira Software, demos the Cumulative ...

261 views 1 2
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you