Home / JQL functions / hasAttachments()
hasAttachments() JQL function for Jira Cloud
Last updated 20/11/2026. Hooks is our product, and this page describes how its built-in function behaves.
hasAttachments() keeps the work items from your inner JQL that have attachments. Syntax: issue in hasAttachments("jql"). With issue not in hasAttachments("jql") you get the ones with none. It works in the search bar, filters, boards and dashboards.
Syntax
issue in hasAttachments("jql")
The matches that have attachments. 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 attachments. |
What it returns
Some work is not ready without evidence: a screenshot on a bug, a signed form on a request, a spec on a feature. hasAttachments turns "does it have the file?" into a filter. You can then build boards that surface the incomplete ones, rather than asking people to check by hand.
Three worked examples
Board filter: bugs with no screenshot
issue not in hasAttachments("project = WEB AND issuetype = Bug AND status = Open")
A triage board shows open bugs that still need a screenshot or log file.
Dashboard gadget: requests with documents attached
issue in hasAttachments("project = ACME AND issuetype = \"Change Request\" AND created >= -30d")
The change manager sees which recent change requests include supporting documents.
Automation: ask for evidence
issue not in hasAttachments("project = PLAT AND status = \"Ready for Review\"")
A rule can comment on review-ready work that has no attachment, asking the author 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 hasAttachments(...) matches every work item except the ones the function returns.
issue not in hasAttachments("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 hasAttachments(...). In Hooks you write issue in hasAttachments(...), 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
- hasComments() - The matches that have comments.
- hasLinks() - The matches that have links.
- hasWorklogs() - The matches that have worklogs.
- All 15 built-in JQL functions, plus
hooked()for your own
Frequently asked questions
How do I list work items without attachments?
Use issue not in hasAttachments("jql"). Not in returns the correct set for every built-in function.
Does hasAttachments return the files?
No. It returns the work items that have attachments, so you can list, count and filter them like any other search result.
How many work items can hasAttachments() 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 hasAttachments()?
Replace issueFunction in with issue in. The name carries over unchanged and takes an inner JQL.