Forums

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

JQL - Filter subtasks when the parent story or task's status is "Done."

Fikra July 11, 2024

I want to query subtasks with the status "Ready To Deploy" when the parent story or task's status is "Done." This is my JQL, but it doesn't work.

 

project = "XX" AND issuetype in subTaskIssueTypes()

and status = "READY TO DEPLOY"

and parent in (

issueFunction(issuetype = story, status = DONE) )

ORDER BY created ASC

2 answers

1 vote
Trudy Claspill
Community Champion
July 11, 2024

Hello @Fikra 

Welcome to the Atlassian community.

Do you get a syntax error for that JQL? I ask because "issueFunction" is not native to Jira JQL. It is provided by some third party apps, such as ScriptRunner. Do you have one of those third party apps?

If you had, for example, ScriptRunner the correct syntax would be

project=XX and issuetype in subtaskissuetypes() and status="Ready to Deploy" and issueFunction in subtasksOf("issuetype=Story and status=Done")

Fikra July 11, 2024

No, I don't have it.

this is the query, but not include the condition where the parent story or task's status is "Done".

project = "XX" and issuetype in subTaskIssueTypes() and status = "READY TO DEPLOY" ORDER BY created ASC

 Any suggestion for this condition?

Trudy Claspill
Community Champion
July 11, 2024

If you have only native Jira functionality you will not be able to create one filter to get those results. You could create one filter to get the parent issues and export those results.

Use can then use the list of parent issue keys from that filter as input to your filter for subtasks. To the JQL you have you would add

and parent in (<insert comma separated list of parent issue keys>)

To get what you want from a single JQL statement would require a third party app.

Fikra July 11, 2024

Thanks in advance @Trudy Claspill . I decided to use" parent in", even though I have to list the all stories down.

0 votes
Prosper Agwegiokhe
Contributor
July 12, 2024

Hi @Fikra,

I’m Prosper, a support engineer at Appfire, and I’m here to help you.
Unfortunately, natively, you’ll not be able to do it dynamically. However, in the app my team works, JQL Search Extensions for Jira, you can use the query below to get your desired results:

project = XX and issue in subtasksOfParentsInQuery("type in (Story,Task) and status = Done") and status="Ready To Deploy"

Please contact our support if you have any other questions about this query.
We’ll be happy to help you!

Best regards.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events