Excluding issues with subtasks in JQL

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

issuetype not in subtaskIssueTypes()

Great answer, but not for this question smile

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

2 votes

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

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
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Posted 11 hours ago in Jira

We want to know what Jira Service Desk apps you're using!

Hi Community! My name is Amir and I’m on the Jira Service Desk product marketing team at Atlassian. Our team would love to understand how you’re leveraging our ecosystem for Jira Service Desk. Wha...

34 views 0 5
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you