Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

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

How to give a JQL subquery inside ParentIssuesOf or ChildIssuesOf

Hi,

I am trying to run a JQL query for Portfolio where I need to see all child issues of a Campaign for which the user story contains a Label = 'ABC'. That means that I would like to add a filder to the childIssuesOf so that when we reach the user story level, if that user story contains a Label = 'ABC' then return the user story and all its parents.

I've tried to do a composed query with childIssuesOf and ParentIssuesOf but they don't accept a query as an argument. I'd like to do something like:

key in ParentIssuesOf(key in childIssuesOf("JIRA-123") AND labels = 'ABC')

the problem is that ParentIssuesOf only accepts an Issue or a List of issues and it doesn't seem to accept a query as an argument.

So how can we pass a JQL subquery to ParentIssuesOf or ChildIssuesOf?

thank you!

 

1 answer

1 accepted

1 vote
Answer accepted

Hi Felipe,

Natively you won't be able to nest this value as covered in these feature requests:

You will want to look into the scripted JQL functions of ScriptRunner "portfolioParentsOf()" and "portfolioChildrenOf()" to pass in a subquery for the search.

The last comment of the JPO feature request gives a really good example on the full query string combinations to use via ScriptRunner

Regards,
Earl

Thank you Earl. I managed to achieve it with ScriptRunner. Thank you.

Like # people like this

How did you achieve this with ScriptRunner please? Do you mind sharing the queries? Also, is ScriptRunner a plugin to be added?

 

In the example given JPO features - 

We can achieve this using four filters in Scriptrunner's JQL functions, but it'd be great if Portfolio's JQL could handle it in one.

JQL Via Scriptrunner

Filter 1 (Get Epics linked to parent Initiatives) - issueFunction in portfolioChildrenOf("project = ABC")

Filter 2 (Get Stories linked to those Epics) - issueFunction in linkedIssuesOfAll ("Filter 1")

 

How do you assign "Filter 1" to a query?

--------

this is what I am trying to do ..

This is my list of all Initiatives, which returns a list of 17 initiatives :
"Value Stream" = "name_of_vs" AND "IOP Baseline" in ("FY21 IOP Baseline") 

I then want to find all epics & stories linked to ALL the initiatives.

Help please :)

issueFunction in issuesInEpics("project = "XXX" AND Issuetype = "EPIC" AND issuekey in portfolioChildIssuesOf("XXXX-XXX")") OR

issuekey in portfolioChildIssuesOf(XXXX-XX) AND issuetype not in (EPIC, Sub-task) AND status != cancelled ORDER BY Rank OR

issuekey in portfolioChildIssuesOf("XXXX-XX")

Like # people like this

issueFunction in portfolioChildrenOf() is not supported in Jira cloud, any suggestions for alternative queries? 

Like Kris Luhr likes this

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira Service Management

JSM June ask me anything (AMA)

Hello Community members! We’re wrapping up the end of JSM June with an Ask Me Anything (AMA) with the Jira Service Management product team. This is your chance to ask all your ITSM questions to o...

125 views 8 10
Read article

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