Forums

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

JQL query for filtering all subtasks of an issue

Monika Brandström
Contributor
October 10, 2019

Hi,

Does anyone know how to write a JQL query to get all subtasks and linked issues to a Story/Task?

 

Regards

Monika

11 answers

1 accepted

14 votes
Answer accepted
Gustav L'Estrade
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.
October 10, 2019

Hello @Monika Brandström

Below JQL-query worked for me, giving me all subtasks and linked issues to my AC-15 issue:

parent = AC-15 OR key in linkedIssues("AC-15")

What above query says: Fetch all issues that have AC-15 as a parent or whose key is linked with AC-15

 

How does it work for you?

Hope it helps and good luck!

13 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.
October 10, 2019

Can you try 

parent = "ISSUEKEY" OR issue in linkedIssues(ISSUEKEY)

Replace the issue key with the issue ID of your story or subtask.

GS1337
Contributor
October 10, 2019

Both functions dont exist in standard Jira.

Like • 2 people like this
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.
October 10, 2019
GS1337
Contributor
October 10, 2019

mhm ur right. I wonder why it doesnt work for my Instance then. . . 

mochadwi
Contributor
December 22, 2021

works in my parts, thanks a lot!

Oliver Emmler
Contributor
March 16, 2022

Hi @Nisha Hajamohideen ,

your solution works great for me in the standard cloud installation. Thanks. I have added an "order by rank" to show the order used in the issue view of jira.

parent = "DOC-9902" ORDER BY rank 

Best Regards,
Oliver

Like • 3 people like this
Marcelo Cid (Antiguo) May 5, 2022

Is there an option to arbitrarily leave any ?
Ex: parent = "ISSUEKEY" that works with the key MAR-2 and for other occasions MAR-3

Like • Tytus Wachowski likes this
lpoddaturi
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!
September 8, 2022

Worked for me, thank a lot @Nisha Hajamohideen 

Mandeep Singh
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!
July 18, 2024

linked issues are different than subtask. how I will find all the subtasks for a story with linked issues?

2 votes
joseph weiss October 10, 2019

issueFunction in linkedIssuesOf("Key=JIRA-100") or issueFunction in subtasksOf("key=JIRA-100")

Sayan Kaiser
Contributor
July 23, 2020

thanks for this one 

Like • Mister Dulaney likes this
Mister Dulaney
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!
May 8, 2022 edited

This worked for me too! Thanks a $milli$!

1 vote
Sita Raghunadh Vedala
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!
May 10, 2022

You can try this in the JQL query search text box - 

issueFunction in subtasksOf("fixversion=37.0") 

You can give your required fix version or use any other filter.

1 vote
Monika Brandström
Contributor
October 13, 2019

Thank you for all your answers. Parent in and linkedIssues was the solution for me.

1 vote
Muhammad Ramzan_Atlassian Certified Master_
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.
October 10, 2019

 JQL Search Extensions for Jira & reports plugin have rich queries which are very useful. You can either use scriptrunner  or   JQL Search Extensions for Jira & reports plugin.

 

I am using  JQL Search Extensions for Jira & reports plugin and its really amazing.

 

Following query will be helpful in your case.

It will return all linked issues and sub tasks linked with JQL-3 or JQL-5

 

issue in linkedBy(JQL-3, JQL-5)

 

you can find more documentation here

https://jqlsearchextensions.atlassian.net/wiki/spaces/SEARCH/pages/30497099/JQL+Reference+Server#JQLReference(Server)-LinksCountLessThan

1 vote
GS1337
Contributor
October 10, 2019

As far as i know there is no JQL in standard Jira for that. You need to get a Plug In. 

0 votes
Tad Foster
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.
June 12, 2023

issuekey in childIssuesOf("your parent issuekey-xxxx GOES HERE")

example: issuekey in childIssuesOf("NMER-9549") where NMER-9549 is the Story and the search results would be the subtasks.

0 votes
MSJ
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 5, 2022 edited

In Jira 8, 

below works fine

Search Issues ==> Advanced ==> In the query field

parent = <ticket no>

0 votes
Salonee Wong
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!
December 9, 2020

I used this query and it works :)

project = "ProjectName AND issuetype not in standardIssueTypes()

0 votes
Thomas B
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.
October 10, 2019 edited

@Monika Brandström You could use a plugin like this one, it works for me!

Once installed, the query should be something similar to:

Suggest an answer

Log in or Sign up to answer