Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to get subtasks of an EPIC in a filter query?

Hi all,

I'm sort of new with JIRA and I am trying to get a board that shows me all work related to an Epic. We are using Epics, Stories and Subtasks of the stories.

My query looks something like 

  • project = CXT AND "Epic Link" = CXT-2120

This way I am not able to display the subtasks on my filter/board.

The alternative would be to use tasks and then manually link them to the Story and to the Epic, which is additional admin work.

Is there something I am missing or is there anyway I can get the subtasks to show in the filter/board?

 

Thanks in advance.

 

3 answers

2 accepted

2 votes
Answer accepted

Hi,

Sadly you cannot achieve the desired search using standard features on Jira, you must go for a third-party app instead. Using i.e. JQL Booster Pack (if you are on Server / DataCenter) you can type the following:

 

0) The Epic itself

key = CXT-2120

1) Subtask created directly on Epic

issue IN subtasksOf(' key = CXT-2120 ')

2) Find all tasks (Tasks, Stories,...) under a given Epic (i.e. CXT-2120)

"Epic Link" = CXT-2120

3) Find all subtasks under returned issues above

issue IN subtasksOf(' "Epic Link" = CXT-2120 ')

4) All together (Epic, Tasks & Subtask)

key = CXT-2120 OR "Epic Link" = CXT-2120 OR issue IN subtasksOf(' key = CXT-2120 OR "Epic Link" = CXT-2120 ')

(*) Note that this is just an example, you must tune above query to fit your needs.

 

Using this app you can also query other issues relations, check:

 

Regards

0 votes
Answer accepted

HI @Paulo Costa 

Welcome to the community.

This works in JIRA Cloud. Try it on your system.

project = CXT AND (issuetype = Story AND "Epic Link" IN (CXT-2120)) OR (issuetype = sub-task AND "parentEpic" IN (CXT-2120))

If it works, credit goes to Mark Klein  for the answer in this post.

https://community.atlassian.com/t5/Jira-Software-questions/JQL-to-show-all-issues-AND-subtasks-in-the-Epic/qaq-p/346433 

@Trudy Claspill , 

Cool information, I didn't know until now that parentEpic existed!

parentEpic - Search for issues and sub-tasks that are linked to an epic.

https://support.atlassian.com/jira-software-cloud/docs/advanced-search-reference-jql-functions/#Advancedsearching-functionsreference-parentepicparentEpic()

Thanks @Trudy Claspill , I have tried and still does not work. I've read the post you shared and also @Italo Qualisoni [e-Core] shared link, and as we are using JIRA Server, looks like we have to buy some add-ins.

If by any chance you have any other ideas I would appreciate.

Adaptavist Scriptrunner is a powerful app that extends JQL search functionality, plus provides many other features. I used it at my previous employer and really liked it.

If that offers more than you want and you are looking for something less expensive, check the Similar Apps links at the bottom of its marketplace page to see if any of those can help with extensions for searching.

@Paulo Costa 

I realise it's a year later, but there's a command called "epicParent" that does just this:

parentEpic = EPIC-1

or

parentEpic in (EPIC-1, EPIC-2)

I hope this helps.

Cheers 

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you