JQL Query to find where one Sub-Task is closed

boellner boellner
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 4, 2025

Hello,

I have this structure

many Stories
   |- 1 Subtask Summary A
   |_ 1 Subtask Summary B

I am looking for a query to find all of those Stories that have Subtask A closed and 
Subtask B in status open.

What would be the query for it?

Thank you

2 answers

1 accepted

1 vote
Answer accepted
Mike Maurer
Contributor
January 4, 2025

I believe with pure JQL this is difficult. Do the subtasks have specific names?

To find Stories where Subtask A is closed and Subtask B is open, you’ll likely need a plugin like ScriptRunner. Something like:


issueFunction in parentsOf("type = Sub-task AND summary ~ 'Summary A' AND status = Closed")
AND issueFunction in parentsOf("type = Sub-task AND summary ~ 'Summary B' AND status = Open")


If you don’t have plugins, you could use Jira Automation:

  • Manual Trigger.
  • Add conditions to check Subtask A is "Closed" and Subtask B is "Open".
  • Mark or tag the parent Story.
  • Filter for the tagged issues.
boellner boellner
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 4, 2025

thank you! this worked out

0 votes
Carlos Garcia Navarro
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 4, 2025

Hi @boellner boellner ,

Welcome to the Community! This can't be done with Jira out-of-the-box, so you may need an add-on. Mike's suggestions are good!

Sharing the link to these other posts for reference, his may provide some other alternatives or workarounds (e.g. exporting to a spreadsheet if this is a one-off task):

 https://community.atlassian.com/t5/Jira-questions/Query-for-open-stories-with-closed-sub-tasks/qaq-p/1133556

https://community.atlassian.com/t5/Jira-questions/Filter-for-open-subtasks-where-parent-is-closed/qaq-p/918110

https://community.atlassian.com/t5/Jira-questions/How-to-find-all-subtasks-under-standard-tickets-with-a-status-of/qaq-p/2530335

Note: For Jira Cloud the issueFuntion can be used as part of the enhanced search functionality (https://community.atlassian.com/t5/Jira-questions/Do-we-have-any-substitute-for-issuefunction-in-JIRA-Cloud/qaq-p/1539971)

Suggest an answer

Log in or Sign up to answer