Home / JQL functions / hasSubtasks()
hasSubtasks() JQL function for Jira Cloud
Last updated 20/11/2026. Hooks is our product, and this page describes how its built-in function behaves.
hasSubtasks() keeps the work items from your inner JQL that have subtasks. Syntax: issue in hasSubtasks("jql"). Use issue not in hasSubtasks("jql") for the ones without. It fills the gap left by plain JQL, which has no "has subtasks" test.
Syntax
issue in hasSubtasks("jql")
The matches that have subtasks. The function name is not case sensitive in the search bar, and you can use it anywhere Jira accepts JQL: the search bar, saved filters, boards, dashboard gadgets and subscriptions.
Arguments
| Argument | What it does |
|---|---|
jql | Required. A JQL query. The function keeps the matches that have subtasks. |
What it returns
Finding stories that were never broken down, or parents that are carrying a lot of child work, is a classic backlog hygiene task. Plain JQL cannot test for subtasks directly. hasSubtasks can, and because you pass the starting set as an inner JQL you stay in control of scope.
Three worked examples
Board filter: stories ready for dev with no breakdown
issue in hasSubtasks("project = WEB AND issuetype = Story AND status = \"Ready for Dev\"")
Use this form to see which stories are already broken down before the sprint starts. Swap in for not in to flip it to the ones that still lack subtasks.
Dashboard gadget: parents carrying subtasks this sprint
issue in hasSubtasks("project = ACME AND sprint in openSprints()")
The scrum master sees which sprint work has been decomposed.
Automation: remind to break down
issue not in hasSubtasks("project = PLAT AND issuetype = Story AND status = \"In Progress\"")
The not in form can drive a rule that nudges owners of in-progress stories with no subtasks.
Saving it as a filter
There is nothing app-specific to save. Compose the query in Jira's own search bar, save it as a normal Jira filter, and use that filter on boards, dashboards, gadgets and subscriptions. The JQL functions tab in Hooks has a Try a search panel that previews the first matches of a query before you save it, which is a quick way to check the inner JQL does what you expect.
Using not in
Every built-in function returns the correct set for not in. issue not in hasSubtasks(...) matches every work item except the ones the function returns.
issue not in hasSubtasks("jql")
Limits you will see
- The inner search scans up to 25,000 matches and the function returns up to 12,000 work items.
- A bigger result shows too many results. You never get a silently cut-off list.
- Results refresh within about 5 minutes of a change to your data.
- A search with an invalid inner query degrades to a no-match result, so a saved filter keeps working.
ScriptRunner equivalent
In ScriptRunner you write issueFunction in hasSubtasks(...). In Hooks you write issue in hasSubtasks(...), and issueFunction not in becomes issue not in. The name carries over unchanged and takes an inner JQL. Saved Enhanced Search filters can be converted in place from the Migrate from ScriptRunner tab, which checks each one against ScriptRunner's current results first. See the migration docs and the Enhanced Search alternative guide.
Related functions
- subtasksOf() - The subtasks of the work items the inner JQL matches.
- hasLinks() - The matches that have links.
- hasComments() - The matches that have comments.
- All 15 built-in JQL functions, plus
hooked()for your own
Frequently asked questions
How do I find work items without subtasks?
Use issue not in hasSubtasks("jql"). The built-in functions return the correct set for not in.
Does hasSubtasks return the subtasks?
No, it returns the parents (the matches that have subtasks). Use subtasksOf to get the subtasks themselves.
How many work items can hasSubtasks() return?
Up to 12,000. The inner search scans up to 25,000 matches, and a bigger result shows too many results instead of a cut-off list.
What is the ScriptRunner equivalent of hasSubtasks()?
Replace issueFunction in with issue in. The name carries over unchanged and takes an inner JQL.