Forums

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

Dynamic Advanced Query to bring in all children

Darryl Beckett
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!
January 12, 2023

Hello I'm on JIRA cloud and we have ScriptRunner Enhanced search installed.

 

Our Hierarchy is:

Initiative

  Epic

    Story

 

At the bottom is the existing query, but I need help to make it scalable. I'm trying to pull in all Initiatives attached to a scrum team (custom field) and it's children. If I can write this dynamically then I don't have to edit the query all the time. I'd like to not have to edit this query each time I add a new initative to the scrum team

 

The current query is:

project = <<PROJECT NAME>> AND issuetype = Initiative AND "Scrum Team[Dropdown]" = <<Scrum Team Name>> OR issuekey in portfolioChildIssuesOf ("<<Initative ID #>>") OR issuekey in portfolioChildIssuesOf ("<<Initative ID #>>") OR issuekey in portfolioChildIssuesOf ("<<Initative ID #>>") OR issuekey in portfolioChildIssuesOf ("<<Initative ID #>>") OR issuekey in portfolioChildIssuesOf ("<<Initative ID #>>") OR issuekey in portfolioChildIssuesOf ("<<Initative ID #>>") OR issuekey in portfolioChildIssuesOf ("<<Initative ID #>>") OR issuekey in portfolioChildIssuesOf ("<<Initative ID #>>") OR issuekey in portfolioChildIssuesOf ("<<Initative ID #>>") OR issuekey in portfolioChildIssuesOf ("<<Initative ID #>>") order by created DESC

1 answer

0 votes
Amed Moreno February 1, 2023

Hi Darryl,

Not sure if Scriptrunner Enhanced Search has a function that would allow the scalability you're looking for. 

However, if you were to get this JQL Search Extensions plugin, you can achieve it with below:

issue in childrenOfIssuesInQuery("project='ACME' and type=Initiative")

 So, like this:

project = <<PROJECT NAME>> AND issuetype = Initiative AND issue in childrenOfIssuesInQuery("project = '<<PROJECT NAME>>' AND issuetype = Initiative")

 

Hope this helps.

Kind Regards,

Amed

Suggest an answer

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

Atlassian Community Events