Forums

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

JQL filter for sub-tasks blocking cousin sub-tasks (has different parent)

Phillip Yohner April 15, 2021

Hi,

I'm struggling to create a query that will return a list of sub-tasks that are blocking other sub-tasks that have a different parent.  For example:

  • Task A
    • Sub-task A1 - blocks Sub-task B1
    • Sub-task A2 - blocks Sub-task A3
    • Sub-task A3 - is blocked by Sub-task A2
  • Task B
    • Sub-task B1 - is blocked by Sub-task A1

Result should be Sub-task A1 since it's blocking Sub-task B1.  Sub-task A2 would not be included in the result since it's blocking a sub-task with the same parent.

I have ScriptRunner installed.

Thought we were on the right track with the following query, but it doesn't return results:

project = ProjectXYZ AND resolution = Unresolved AND issueLinkType = blocks AND parent not in parentsOf("issueFunction in linkedIssuesOf('issueType = Sub-task', 'is blocked by')") ORDER BY priority DESC

Any suggestions appreciated!

1 answer

0 votes
Trudy Claspill
Community Champion
April 16, 2021

I haven't worked out the right query, but I can tell you why the one you have doesn't return any results.

The first part of your query

project = ProjectXYZ AND resolution = Unresolved AND issueLinkType = blocks 

...will return Sub-task A1 and Sub-task A2 because those both have the "blocks" link type.

 

This part of your query

("issueFunction in linkedIssuesOf('issueType = Sub-task', 'is blocked by')"

...will return Sub-task A3 and Sub-task B1 because they each have a link of "is blocked by".

 

So then

parenstsOf(Sub-task A3, Sub-task B1)

... will return Task A and Task B, which leaves you with

parent not in (Task A, Task B)

 

The first part of your query returned Sub-task A1 and Sub-task A2. Their parent is Task A. But the second half of your query discards these Sub-tasks, because their parent (Task A) is in the "parent not in (Task A, Task B)" criteria.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events