Excluding issues with subtasks in JQL

Russell Howe August 19, 2012

The answer may well be "don't do that" but it seems like a legitimate use case to me.

We have an issue type ("Job") which allows subtasks ("Tasks"), but which do not always have subtasks.

We set time estimates on the subtasks, but if there aren't any subtasks (it is a straightforward job which doesn't need breaking up into components) we just set a time estimate on the Job itself.

I would like to query for all issues which should have a time estimate but don't, i.e. "All Jobs and Tasks except Jobs which have subtasks" or "All Tasks and also Jobs which don't have subtasks". I'm trying to avoid creating a separate issue type for the "simple job"s

My JQL looks like this currently:

project = MyProject and issuetype in ("Job", "Task" ) and status not in (resolved, closed) and fixVersion in unreleasedVersions() and timeestimate is empty

2 answers

7 votes
Federico Rela June 10, 2013

issuetype not in subtaskIssueTypes()

pelizza
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.
February 4, 2016

Great answer, but not for this question smile

By the way, it helped me on another situation...

Jeret Shuck December 12, 2019

Great answer! First click, first thing that worked for me. 

2 votes
Jobin Kuruvilla [Adaptavist]
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 19, 2012

JQL Tricks plugins has a hasSubtasks method which you can use in this query. It is a commercial plugin, btw!

Russell Howe August 19, 2012

Yeah, I saw that. This isn't a problem which is worth any money to me, unfortunately.

Suggest an answer

Log in or Sign up to answer