How to query stories and their linked subtasks in one query?

IT Accounts August 3, 2016

How to filter stories and their linked subtasks in one JQL query? Is it possible?

2 answers

0 votes
Indy Sue October 20, 2020

Solution... 3 filters required...

1. STORIES filter called '369_Stories':  

issuetype in (story, PTR) AND cf[13056] = SAMSS-369 ORDER BY Key

2. SUB-TASKS filter called '369_Subtasks':

issuefunction in subtasksof("filter = 369_Stories") OR issuetype in (Sub-task) AND issuefunction in linkedissuesof("key = SAMSS-369")

3. COMBINED STORIES & SUB-TASKS filter called '369':

filter in (369_Stories, 369_Subtasks)

0 votes
105349
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.
August 3, 2016

Hello!

This is just a quick query I threw together.  It returns Stories that have Sub-Tasks; and you can add the Sub-Tasks column to see the Sub-Tasks.

issueFunction IN hasSubtasks() AND issuetype = Story

I'll see if I can come up with one that returns Stories and Sub-Tasks together.

Thanks!

Steven F Behnke
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.
August 3, 2016

Sorry but it's just not possible without plugins. The technology just isn't there yet. wink

IT Accounts August 10, 2016

I've found solution:

project = "ProjName" AND ( status in ("To Do", "In Progress", Done) AND type = sub-task AND issueFunction in subtasksOf("status in ('StoryStatus1','StoryStatus2','StoryStatus3')") OR status in ('StoryStatus1','StoryStatus2','StoryStatus3') AND issuetype = Story ) ORDER BY RANK ASC

Like Rocky Y likes this

Suggest an answer

Log in or Sign up to answer