Filter by subtasks depending on other subtasks
Asked by Pauline Hild:

Hello,

I want to create a filter that shows me a certain subtask (conditions see screenshot), but only if the subtasks that need to be done before ("Isolation", "Sample QC" and "Library") already have the status "Done" or "not needed". How must the syntax look like for this?

![Bildschirm?foto 2023-04-11 um 15.37.30.png](/t5/image/serverpage/image-id/251040i5C9029E68DF2F201/image-dimensions/568x21?v=v2 "Bildschirm?foto 2023-04-11 um 15.37.30.png")


Answers:
author: Trudy Claspill
body: Hello [@Pauline Hild](/t5/user/viewprofilepage/user-id/4773022)

How do you know the other subtasks need to be done before the one you want to retrieve? Are they linked in some way?

I don't think there is actual a way to do this with native Jira search functionality, but it might be possible with third party apps that extend the search functionality with additional functions.

comments: author: Pauline Hild
body: Hello [@Trudy Claspill](/t5/user/viewprofilepage/user-id/3569011)

Each task has the same subtasks, which must all be processed in the same order one after the other. They are created in this order by an automation (see screenshot), but are otherwise not linked to each other.  
The filter should show tasks where the first three tasks are already done, but the fourth task is not yet done. I hope it is now clear what I meant.

![Bildschirm?foto 2023-04-12 um 14.50.09.png](https://community.atlassian.com/t5/image/serverpage/image-id/251293i941A47DE361AF380/image-size/large?v=v2&px=999 "Bildschirm?foto 2023-04-12 um 14.50.09.png")


author: Trudy Claspill
body: I can't think of a method to do this with native Jira JQL functionality.

Jira JQL doesn't have any function to select subtasks based on the order they appear in the list, so there is no method in JQL for Jira to know which subtasks need to be completed (based on issue ordering) before the one you want to retrieve.

If you used issue linking to link the subtasks, so that each subtask was linked to the preceding subtasks with a "depends on" or "blocked by" link, then with the aid of third party apps you *might* be able to construct a query to get what you want.

It *might* be possible to construct an [Automation Rule](https://support.atlassian.com/jira-software-cloud/docs/automate-your-jira-cloud-processes-and-workflows/) that would first retrieve all the #4 subtasks, and then check if the first three tasks associated with the same parent are completed. I'm not positive because I haven't tried to work through the details.

How often do you need/want to get this report?

What do you need/want to do with the report? Does it need to be emailed to people?


author: Pauline Hild
body: Since the names of the subtasks are always the same, I thought that in addition to the other search criteria, it might be possible to enter in the syntax that all subtasks with a certain summary (the subtasks are always named the same) must have the status "Done" or "not needed", but I haven't managed to do that yet.

The report is supposed to provide information about the status of the projects from time to time. The purpose of the filter is to get a quick overview of how many projects still have this subtask open, so that you can do it for several tasks at the same time.


Tags: cloud

jira-work-management-cloud