how to filter out all issues were all descendants have been completed



We have a structure with a number of top level issues, and then descendants up to 8 levels deep.
We would like to create a query such that has only entries where the leaf level are not resolved.


Wondering how we can do this with S-JQL




2 answers

1 accepted

Hi Francis,

You can indeed do this with S-JQL, the query will look something like this:

issue in structure(structureID, "leaf AND [resolution = unresolved]")

This query will return only the unresolved leaf issues in the specified structure.

You can also reference the structure by name, but remember to enclose the name in double quotes ("") if it contains spaces or non-letters.

You can find more details in the documentation: Combining S-JQL constraints with Boolean operators.




While Robert's answer is correct in that it returns unresolved leaf issues, it seems like you need to display top-level issues that have unresolved leaves. This is achieved by:

issue in structure(structureID, "root and descendant in (leaf and [resolution is empty])")

That one just returns the top leven one (due to the 'root and'). I'm starting to understand how this works. The complete query which returns what I want is root or descendant in (leaf and [resolution is empty]) or (leaf and [resolution is empty])

So - you need the complete branches, right? I.e. if you have a structure A - B -- C (resolved) D - E -- F (unresolved) you want to see D, E, F? In this case, you'll need issue or ancestor of (leaf and [resolution is empty]) this query translates as: find all unresolved leaves, and return them and their ancestor (up to the root). Also note that your query has "root or ..." which will return, among other things, all top-level issues regardless of whether there are unresolved leaves under them or not.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Mar 13, 2019 in Marketplace Apps

Marketplace Spotlight: Marketing apps for Confluence to keep your teams working on the same page


254 views 0 6
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you