Forums

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

JQL to find portfolio parents only when all the immediate portfolio children are completed

Averil Stewart June 7, 2023

Hi People,

I am trying (unsuccessfully of course!) to find a JQL that will return me a Portfolio Parent ticket that is OPEN, but only when all of its immediate children are all done. This is useful as I can then chase the Parent Owner to see if we can mark it done. Sounds reasonable I hope.

Unfortunately, I seem unable to exclude it from finding the Portfolio Parent that is open with done Children without it also listing those with open children at the same time.

example:

Portfolio Parent issuetype is "Status = "In Progress" and it has 10 x Portfolio Children issuetypes.

When all of the 10 Portfolio children issuestypes are in "Status = Done", I want my filter to return Portfolio Parent.

But I do not want to see Portfolio Parent returned if only 9 of my Children are Done and 1 is still Open...

Any ideas?

 

When 

1 answer

0 votes
Trudy Claspill
Community Champion
June 8, 2023

Hello @Averil Stewart 

Welcome to the Atlassian community.

I don't believe that native Jira filtering is capable of doing that. 

Would you consider, or do you already have, third party apps that extend the filtering capabilities?

Averil Stewart June 20, 2023

yes we have scriptrunner in situ if this assists.

 

..is it just me thinking that bundling in a tool like AR with little native functionality for its hierarchy, seems a poor idea

Trudy Claspill
Community Champion
June 21, 2023

Hello @Averil Stewart 

I think the ScriptRunner function portfolioParentsOf() might suit your requirement

issueFunction in portfolioParentsOf("statusCategory=Done") AND
issueFunction not in portfolioParentsOf("statusCategory!=Done") AND
statusCategory != Done

The first line gets you all the Parent issues that have child issues that are in a Done status category.

The second line excludes the Parent issues that have child issues that are not Done.

The third line further constrains the Parent issues to only those that themselves are not Done.

You may want to add other criteria to restrict the projects that are searched or the issue types that are considered.

Suggest an answer

Log in or Sign up to answer