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

Janene Pappas
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.
September 3, 2019

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

0 votes
Janene Pappas
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.
September 4, 2019

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 ?

0 votes
Muhammad Ramzan(Atlassian Certified Master)
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.
September 3, 2019

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

Janene Pappas
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.
September 4, 2019

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?

Muhammad Ramzan(Atlassian Certified Master)
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.
September 4, 2019

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.

Janene Pappas
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.
September 5, 2019

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?

Daniel Turczanski - __JQL Search Extensions
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
September 9, 2019

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

Suggest an answer

Log in or Sign up to answer