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 include sub-tasks in a filter

I have this filter to give me what was completed this week across a couple projects.  I only get the Tasks, but no Sub-tasks.  Anyone know how to get the done tasks and done sub-tasks?  I would want the done sub-tasks even when the parent tasl may still be open.

project in (project1, project2) AND status = Done AND resolved >= -1w AND assignee in (user1, user2, user3) ORDER BY "Epic Link"

Thanks,

 

Morgan

5 answers

you can include subtasks in filters without a plugin... here is an example that works - we used components to segregate boards on PROJECTNAME: 

project = PROJECTNAME AND component = COMPONENTFORFILTER OR issueFunction in subtasksOf("component = COMPONENTFORFILTER ") ORDER BY Rank ASC

IssueFunction isn't OTB JQL

the question doesn't mention OTB as a requirement - just that a solution is required.  I believe I answered the question with yet another option.

Apologies Cathleen, I mistakenly thought you were reply to another post.

Thanks Cathleen, this worked a treat for me.

e.g. for others:
AND Component = Finance or issueFunction in subtasksOf("component = Finance")

Seems can't find subtasksOf function today in (2021), also write a comment about the alternative:

https://community.atlassian.com/t5/Jira-Software-questions/Re-Re-JQL-to-show-all-issues-and-subtasks-in-an-epic/qaq-p/1850003/comment-id/168416#M168416

 

tl;dr

linkedissue = SAPP-10885 OR linkedissue = SAPP-10787

Are there any subtasks macthing this query? If you expect the subtasks that belong to all the tasks matching this query, that is not how it works.

Subtasks are just another issuetype and they will be returned in the result only if they match the conditions in the query. If you need subtasks from tasks matching to certain criteria, you will need a pliugin like JQL Tricks

Thanks!  I will look into that.  We're using the Cloud version...

AnnWorley Atlassian Team Apr 24, 2017

This plugin is compatible with Cloud and promises to "find issues by Link, work log, subtasks, comments, etc"

JQL Plus (Mongo Search)

I don't think we should have to buy a plugin for such a basic functionality

Like # people like this

Yes, it seems you have to buy a plugin to do many basic things in Jira.  I'm glad Atlassian is investing in new technologies, but I wish they would go back and address so many of the simple things that instead get resolved by third parties.

I've wasted countless hours searching for solutions only to find I need to buy a plugin.

Like Stephen Elliott likes this

For Example, I want to query all sub tasks of a given issue type.  I have to write and maintain a list of parent keys ex. parent in (xxx-1, xxx-2, etc.) or pay for another plugin

Like Stephen Elliott likes this

I have found more practical solution:

  1. Goto parent task in Jira
  2. Click on 3dots above the subtasks list 
  3. Click on view in search 

You will get JQL like:

issueKey in (ABC-111,ABC-222,ABC-333,...)

 

Thanks 

@Tomer Madmon 

Hi community!

This is an old question but I'm sure this answer is helpful today.

With standard JQL, you can only get a list of issues and export them to Excel for further processing. This works if you want to do a one-off analysis. If your use case is more dynamic than that, look beyond standard Jira.

Standard JQL doesn't easily allow it, but you can quickly find the results using our professional indexing service JQL Search Extensions

After you install the app, you can simply search:

issue in subtasksOfParentsInQuery("project in (project1, project2) AND status = Done AND resolved >= -1w AND assignee in (user1, user2, user3)")

Check out the documentation for more examples.

I hope this helps!
Daniel

Hi all, 
I have the same issue in Jira Next Gen, I cant filter based on Subtasks. Any help, please? 

Same here- seems to be a glitch of some sort.  If I create a simple filter 'project = GSTA ORDER BY Rank ASC', I get subtasks.  As soon as I add to the filter 'project = GSTA AND labels != Post_MVP ORDER BY Rank ASC' my subtasks disappear.

Reason is, that the subtasks have no labels and are therefore excluded from the result when you filter by label...

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