Hooks / Docs / JQL functions and saved searches
JQL functions and saved searches
Last updated 01/10/2026
Hooks registers sixteen JQL functions into Jira's native search — usable in the search bar, saved filters, boards, dashboards, and subscriptions.
Each built-in has its own page with syntax, worked examples and the ScriptRunner equivalent: see the JQL functions guide.
Fifteen built-ins (no script needed)
Each supports in / not in, and all but previousSprint take an inner JQL as their argument:
linkedIssuesOf · linkedIssuesOfRecursiveLimited · ancestorsOf · descendantsOf · subtasksOf · parentsOf · epicsOf · childrenOf · issuesInEpics · previousSprint · hasSubtasks · hasLinks · hasAttachments · hasComments · hasWorklogs
issue in linkedIssuesOf("project = ABC AND status = Blocked") AND priority = Highest
linkedIssuesOf takes an optional second argument to follow only one link type, for example linkedIssuesOf("project = ABC", "is blocked by"). not in returns the correct work items for every built-in function.
Each 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. They follow ScriptRunner's meaning: issuesInEpics("…") returns the work items parented under the epics among the matches (any epic-level type, renamed ones included) in every kind of project, and issuesInEpics("…", "epicLink") works like ScriptRunner's issuesInEpics, through the Epic Link field (company-managed projects; on a site without Epic Link it behaves like the one-argument form). Migrated ScriptRunner filters use the "epicLink" form. epicsOf recognises any epic-level parent; linkedIssuesOf, subtasksOf and parentsOf also return matches related to other matches (so subtasksOf("project = ABC") returns the project's subtasks) (linkedIssuesOfRecursiveLimited still leaves out the starting matches).
descendantsOf without a filter returns every level of descendants (walking up to 25,000 work items; the 12,000 limit applies to work items that have children), including a match that sits under another match. New children of a work item that already had children appear straight away; children under a work item that had none appear after the next refresh (usually within about a minute). With a filter it returns the exact list of matching descendants (a match under another match included), up to 12,000 work items; a filter Jira can't read is reported as an error even when there are no descendants.
previousSprint("board") returns the work items in the board's most recently completed sprint, counting only sprints created on that board, like ScriptRunner: issue in previousSprint("Team A board") AND resolution is EMPTY. Give the board's name or its ID (the number in the board's URL); if several boards share the name, use the ID. A board with no completed sprint, or without sprints (Kanban), matches nothing. not in also returns work items that were never in a sprint.
hooked() — your script as a search
Save an onJql hook and its name becomes a search: issue in hooked("unassigned-recent"). The script returns either a JQL string or an array of work item keys (capped at 1,000). With not in, a key-list result is inverted automatically (every work item except those keys); a JQL-string result is used exactly as returned, so a script returning JQL should read context.jql.operator ("in" or "not in") and return the JQL for the operator it receives. Broken hooks degrade to a valid no-match result — a saved filter never breaks — and every evaluation is recorded in Run history.
Migrating ScriptRunner filters
The Migrate from ScriptRunner tab finds your ScriptRunner Enhanced Search filters, checks them against ScriptRunner's results and moves them over. See Migrate from ScriptRunner.
Checking migrated ScriptRunner filters
When the check finds a difference, Hooks also looks at whether ScriptRunner's own copy of the results is simply out of date (ScriptRunner stops refreshing filters nobody has used for two months). If almost all of the work items only ScriptRunner returns are now Done - clearly more than the work items both sides return - and any extra work items Hooks returns were created in the last 60 days, the check says ScriptRunner's copy looks out of date with those counts (of the first 500 checked on each side, for large differences). The filter is still not marked as verified: review it and use Migrate selected anyway if you agree.
Saved complex searches (the Enhanced Search pattern)
There is nothing app-specific to save: compose the query in Jira's own search, save it as a normal Jira filter, and use that filter on boards, dashboards, and subscriptions. The JQL functions tab has a Try a search panel to preview a query's first matches before saving. Hooks keeps the function results current wherever the filter is used: searches reflect hook changes immediately and data changes within a few minutes. Nesting one custom function inside another's argument is not supported — flatten with a single hooked() script.