JQL filter for Stories without Subtasks? (without plugin)

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()

2 answers

1 accepted

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.

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

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

Suggest an answer

Log in or Join to answer
Community showcase
Teodora [Botron]
Published Feb 15, 2018 in Marketplace Apps

Jira Inferno: The Nine Circles of Jira Administration Hell

If you spend enough time as a Jira admin - whether you are managing a single, mid-sized instance, a large enterprise one or juggling multiple instances at once - you will eventually find yourself in ...

1,142 views 6 19
Read article

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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot