Query to get all subtasks associated to stories with some labels in Jira

4.9k Views Asked by At

I have user stories in Jira with some labels A,B,C for example. But at subtasks level there is no labeling. Now I need to fetch count of all user stories of that label, their tasks and subtasks.

How can I get subtasks which have no labels but linked to labelled user stories?

2

There are 2 best solutions below

0
Kemal Kaplan On

You can use the following JQL if you have scriptrunner;

( issue IN subtasksOf('type=Story and labels in (label1, label2)') or issueFunction in linkedIssuesOf('type=Story and labels in (label1, label2)')  ) and labels is EMPTY

It both finds the subtasks, and linked issues of the story labeled as label1 and label2. It also filters the issues with own labels.

2
Sohag Miah On
issuetype in (Task-Agile, Sub-task) AND issueFunction in subtasksOf("Issuetype = story")