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

JQL filter for Stories without Subtasks? (without plugin)

Mike Shkolnik Apr 04, 2016

I know this has been asked before but the threads are old and the solutions do not appear to work with current Jira. My goal is simple - I need a JQL filter that shows all the plan items (Stories, Bugs, and Chores) that do not have any Subtasks. JIRA version is 6.4.3 with JIRA Agile 6.7.2. I am not permitted to install any plugins (such as "JQL Tricks").

In theory " hasSubtasks()" has been native in JIRA for some time, but does not appear to work. Perhaps I am using it wrong? I tried "issue not in hasSubtasks()" as well as "not (issue in hasSubtasks())" and I still get issues with subtasks. Weird thing is "issue not in hasSubtasks()" shows items that have subtasks while "issue in hasSubtasks()" shows nothing. Not one single item. And I know I have some issues with subtasks because they show when I add "not" smile. Here is the full filter I am experimenting with:

issuetype in (story, chore, bug) AND Sprint in openSprints() AND status != Closed AND issue not in hasSubtasks()

5 answers

1 accepted

4 votes
Answer accepted
Nicolas Bourdages Apr 04, 2016

hasSubtask() is not native to JIRA. This is the list of native 6.4 functions. It's available in Scriptrunner with this notation:

issueFunction in hasSubtasks() 

Perhaps you have a different plugin? http://www.j-tricks.com/jqlt-subtask-functions.html has a "hasSubtasks()" function with the notation you describe.

Mike Shkolnik Apr 04, 2016

That did it! "issueFunction not in hasSubtasks()" is the correct answer. Not sure what "issue not in hasSubtasks()" was doing. Thank you very much!

1 vote
Charlie Demsky Jul 05, 2017

I've asked support to open a feature request for this to be added as a native function:

 

https://jira.atlassian.com/browse/JRACLOUD-67108

1 vote
Amit Namdhari May 23, 2018

Solution without a plugin.

Use below query as a Quick Filter from the Board Configuration.

issueFunction not in hasSubtasks() AND issuetype != Sub-task

It will sort out every story, which has No or Zero sub-tasks.

Mike Shkolnik May 23, 2018

That solution requires the ScriptRunner plugin. Basically $1000 per month just for me to use JQL extensions... That's not going to happen at the current job. Two years ago when I posted this question I apparently wasn't aware we were using ScriptRunner at the old job.

Larry Brock Community Leader Nov 26, 2018

Hi @Mike Shkolnik,

Would a no-cost add-on be acceptable?  Not sure if there is one but thought I'd clarify before I want digging.

~~Larry Brock

Like Tamra Smith likes this
1 vote
Reg Hawkins Sep 21, 2018

project = <project name> AND Sprint = <Sprint Name> AND issuetype in subtaskIssueTypes()

Rafael García Feb 14, 2019

That will select the subtasks not the issues with no subtask...

Like Mark Chadbourne likes this
Nam Nguyen Phuong I'm New Here Mar 11, 2019

Then you can use the JQL:

project = <project name> AND issuetype in (Story, Task) AND issuetype not in subTaskIssueTypes()

Thank you Reg Hawkins

Like Sachin likes this
Rafael García May 13, 2019

That will select the stories with or without subtasks not the issues with no subtask...

Like Mark Chadbourne likes this
0 votes
gowri goli Jul 31, 2018 • edited

In latest Jira instance I can select Sub-Tasks as a column in the query. is this what you are looking for? AND Subtask IS EMPTY?

Arjen Breur Aug 27, 2018


Subtask does not exist:

Subtask IS EMPTY
-> Field 'Subtask' does not exist or you do not have permission to view it.

 

Subtasks does, but is not searchable:

Subtasks IS EMPTY
-> Field 'Subtasks' is not searchable, it is only sortable.

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Posted in Jira Core

How to manage many similar workflows?

I have multiple projects that use variations of the same base workflow. The variations depend on the requirements of the project or issue type. The variations mostly come in the form of new statuses ...

677 views 7 0
Join discussion

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