JQL-search for sub-tasks in a parent tasks having all other sub-tasks closed

Andrey Tyupov March 21, 2018

Hello,

 

Is it possible to search with JQL for a sub-task where all the other sub-tasks of a parent task except the one being searched for have the status 'closed'?

 

For example, I have the following structure of issues

- Parent Task1

---Sub-task 1.1 - 'Label1' - Closed

---Sub-task 1.2 - 'Label2' - Open

---Sub-task 1.3 - 'Label3 -  Open

- Parent Task2

---Sub-task 2.1 - 'Label1' - Closed

---Sub-task 2.2 - 'Label2' - Closed

---Sub-task 2.3 - 'Label3' - Open

 

So I want to find that sub-task 2.3. Is it possible with JQL?

3 answers

1 accepted

1 vote
Answer accepted
Igor Sereda [ALM Works]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 21, 2018

Hi Andrey!

Just in case you are using Structure add-on and have this hierarchy as a structure, you can use S-JQL filter like

[status = Open] AND NOT (sibling of [status = Open])

Or, if you need it in a JQL statement somewhere,

issue in structure("my structure name", "[status = Open] AND NOT (sibling of [status = Open])")

Let me know if you need further help with this!

Igor

Andrey Tyupov March 22, 2018

Hi Igor,

Yes we are using Structure here.

I have tried it and it works just as we need.

Thanks a lot for the help!

Andrey

Igor Sereda [ALM Works]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 22, 2018

Great! Happy to help. 

Igor

1 vote
Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 21, 2018

It is not possible out of the box. I think you would need to write your own JQL function with Power Scripts, ScriptRunner or your own plugin.

0 votes
Nisha Hajamohideen
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 21, 2018

Hello

Have you tried project = "PROJECT NAME" and type = Sub-task and resolution is EMPTY ?

this will list all open subtasks in your project.

 

If you want just the list under specific parent ticket try:

Resolution is EMPTY AND parent in (ISSUEKEY)

Surendar December 11, 2019

I need to query open subtasks where parent status is in Done.

I don thave parentsof function permission or functionality in our project.

Suggest an answer

Log in or Sign up to answer