Home / JQL functions

JQL functions for Jira Cloud: the 15 built-ins in Hooks

Last updated 20/11/2026. One page per function, with syntax, worked examples and the ScriptRunner equivalent.

Hooks adds 15 built-in JQL functions to Jira Cloud's own search, using the names ScriptRunner users already know. Write issue in hasLinks("project = ABC") in the search bar, a saved filter, a board or a dashboard. Fourteen take an inner JQL; previousSprint takes a board. Your own scripts join them through hooked().

Try Hooks free for 30 days →

Links and hierarchy

FunctionWhat it returns
linkedIssuesOf()Work items linked to anything the inner JQL matches, optionally through one link type.
linkedIssuesOfRecursiveLimited()Linked work items, followed through further links up to a depth you set.
ancestorsOf()Parents, grandparents and so on up the hierarchy of the matches.
descendantsOf()Every level of work items underneath the matches, optionally only those matching a filter.
subtasksOf()The subtasks of the work items the inner JQL matches.
parentsOf()The parents of the work items the inner JQL matches.
epicsOf()The parent epics of the work items the inner JQL matches.
childrenOf()The direct children of the matches, one level down.
issuesInEpics()The work items in the epics among the matches, with an epicLink form that follows the Epic Link field.

Sprints

FunctionWhat it returns
previousSprint()The work items in a board's last completed sprint.

Has-style tests

FunctionWhat it returns
hasSubtasks()The matches that have subtasks.
hasLinks()The matches that have links.
hasAttachments()The matches that have attachments.
hasComments()The matches that have comments.
hasWorklogs()The matches that have worklogs.

Your own functions with hooked()

For logic the built-ins do not cover, save a script as an onJql hook and its name becomes a search: issue in hooked("unassigned-recent"). The script returns either a JQL string or a list of work item keys, capped at 1,000 keys. With not in, a key list is inverted for you. A JQL string is used exactly as returned, so a script that returns JQL should read context.jql.operator and return the JQL for the operator it receives. A hook that is missing, disabled or throwing degrades to a no-match result, so your saved filter never breaks.

Rules that apply to every function

Moving from ScriptRunner

Replace issueFunction in with issue in. Three mappings to remember: childrenOf becomes descendantsOf, parentsOf("q", "all") becomes ancestorsOf("q"), and issuesInEpics("q") becomes issuesInEpics("q", "epicLink"). The Migrate from ScriptRunner tab does these conversions for saved Enhanced Search filters. See the Enhanced Search alternative guide for the full walk-through.

Frequently asked questions

What JQL functions does Hooks add to Jira?

Fifteen built-ins with ScriptRunner names: linkedIssuesOf, linkedIssuesOfRecursiveLimited, ancestorsOf, descendantsOf, subtasksOf, parentsOf, epicsOf, childrenOf, issuesInEpics, previousSprint, hasSubtasks, hasLinks, hasAttachments, hasComments and hasWorklogs. A sixteenth, hooked(), runs your own script as a search.

Where can I use these functions?

In Jira's own search bar, saved filters, boards, dashboards and subscriptions. Save the query as a normal Jira filter and use that filter anywhere.

Are there size limits?

Each function scans up to 25,000 matches of its inner JQL and returns up to 12,000 work items. A bigger result shows too many results instead of a cut-off list.

Do I rewrite my ScriptRunner queries?

Mostly just replace issueFunction in with issue in. A few functions are renamed or take an extra argument: childrenOf becomes descendantsOf, parentsOf with "all" becomes ancestorsOf, and issuesInEpics gains an "epicLink" argument.

Try Hooks free for 30 days → Docs: JQL functions