Home / JQL functions / hasLinks()

hasLinks() JQL function for Jira Cloud

Last updated 20/11/2026. Hooks is our product, and this page describes how its built-in function behaves.

hasLinks() keeps the work items from your inner JQL that have links to other work items. Syntax: issue in hasLinks("jql"). Use issue not in hasLinks("jql") to find the ones with no links at all. Plain JQL has no direct "has links" clause, which is why people search for it.

Try Hooks free for 30 days → All 15 functions

Syntax

issue in hasLinks("jql")

The matches that have links. 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

ArgumentWhat it does
jqlRequired. A JQL query. The function keeps the matches that have links.

What it returns

Orphaned work is a quiet problem: bugs nobody tied to a feature, tasks with no dependency recorded, tickets that should reference an incident but do not. hasLinks makes those checks one query. You pick the starting set, and the function tells you which ones are connected.

Three worked examples

Board filter: bugs with no linked feature

issue not in hasLinks("project = WEB AND issuetype = Bug AND statusCategory != Done")

A triage board shows open bugs that are not linked to anything, a prompt to find the related story.

Dashboard gadget: connected escalations

issue in hasLinks("project = ACME AND labels = escalation AND created >= -30d")

Shows escalations that have been tied to other work, so you can see which have a recorded cause.

Automation: ask for a link

issue not in hasLinks("project = PLAT AND issuetype = Incident AND resolved >= -1d")

A rule can comment on resolved incidents that have no linked problem record, asking the owner to add one.

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 hasLinks(...) matches every work item except the ones the function returns.

issue not in hasLinks("jql")

Limits you will see

ScriptRunner equivalent

In ScriptRunner you write issueFunction in hasLinks(...). In Hooks you write issue in hasLinks(...), 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

Frequently asked questions

How do I find work items with no links?

Use issue not in hasLinks("jql"). The built-in functions return the correct set for not in.

Does hasLinks return the linked work items?

No. It returns the matches that have links. For the work items on the other end, use linkedIssuesOf.

How many work items can hasLinks() 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 hasLinks()?

Replace issueFunction in with issue in. The name carries over unchanged and takes an inner JQL.

Try Hooks free for 30 days → Docs: JQL functions