Forums

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

Need to find issues with more than one parent link

joeWeiss
Community Champion
February 25, 2020

In my world each issues should have one parent

  • story has one parent epic
  • epic has one parent program epic
  • program epic has one parent portfolio epic

 

Can I run a query to find any issue type with more than one parent?

1 answer

0 votes
Earl McCutcheon
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 26, 2020

Hello @joeWeiss ,

I am not sure I understand what your looking for so please correct me if this is not the case, but are you saying you want to find all issues at the Story level, where those Story issue types have an Epic that also has an initiative as the parent of the epic?

If this is what you are looking for, you would have to do this as a two parter, and do note there are some caveats to searching on the parent link field described in the feature requests "JPOSERVER-2734" AND "JPOSERVER-2477" with some concepts on this field that come into play for how the parent link field crosses the hierarchies on the concept of what a parent issue falls under that you should be aware of when crafting the JQL.

The first query would be to identify all the epic issues that exist in a plan with parent initiatives:

issuekey in issuesInPlan(1) AND issuetype = Epic AND "Parent Link" is not EMPTY

Next using the values returned from the above filter do a follow up but you would still need to manually pump in the values from the first query into the second one as there is not an option to nest queries in JQL:

issuekey in issuesInPlan(1) AND issuetype in standardIssueTypes() AND "Parent Link" in (EPIC-1,EPIC-2,etc....)

A feature that would help out here would be an option to do a nested query which we are tracking at the following request, make sure to add a vote to this one to show your interest as a native function, as a nested query would allow for combining query 1 and 2 into a single run:

As a workaround mentioned in the comments of that feature request its noted that the add-on app PowerScripts may work as a possible workaround to accomplish a nested combo JQL and I would recomend checking it out so see if it would fit this need:

Monte Montoya added a comment - 07/May/2018 6:42 PM

Using the power scripts app , you can solve this use case and really extend JQL across nested queries, linked issues, parent issues and more (more info)

I also know that ScriptRunner has some scripted JQL options for nesting queries as well, but I cannot confirm if it applies to this specific use case but they may also apply and would be a good one to check out as well as an alternative.

Regards,
Earl

Suggest an answer

Log in or Sign up to answer