Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Find parents where ALL sub-tasks meet a condition

stringsonfire
Contributor
August 7, 2020

How can I find parent issues where ALL of their sub-tasks meet a condition (not just "at least one")?

We have ScriptRunner, and I've been looking at the Subtasks issue functions, but so far I haven't figured this out. There's an example for "at least one open subtask", but there is not an equivalent for something like "all subtasks are open".

1 answer

1 accepted

1 vote
Answer accepted
Tansu Akdeniz
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 7, 2020 edited

Hi @stringsonfire 

You can use the following query according to your needs:

  • issueFunction in parentsOf("WRITE_SUBTASK_QUERY")

Ex; it returns parent issues where there are sub-tasks resolved. 

  • issueFunction in parentsOf("resolution is not EMPTY")

EDIT - it returns parent issues where all sub-tasks are resolved. 

  • issuefunction in parentsOf("type in subtaskIssueTypes()") and not issuefunction in parentsOf("resolution is EMPTY")

Regards.

stringsonfire
Contributor
August 7, 2020

That works for parents that have at least one subtask matching the condition, but it does not only show parents where ALL subtasks of the parent match the condition.

Tansu Akdeniz
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 7, 2020

Got it. It should definitely work.

issuefunction in parentsOf("type in subtaskIssueTypes()") and not issuefunction in parentsOf("resolution is EMPTY")
stringsonfire
Contributor
August 7, 2020

Thanks, it's quite a bit more fiddly to set up with complex conditions vs some kind of "parentsOfOnly()" function, but as I don't think that exists this will definitely get me the query results I'm after

stringsonfire
Contributor
August 7, 2020

Do you want to edit your answer so that I can accept it?

Tansu Akdeniz
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 7, 2020

I edited my answer.

Suggest an answer

Log in or Sign up to answer