JQL text search: contains, phrases and wildcards
Short answer
Use the ~ (contains) operator. To search summary, description, environment and comments at once, use the text field:
text ~ "timeout error"
Jira text search matches words, not character substrings, so this finds work items that contain both words anywhere, in any order.
Queries you can paste
| You want | JQL |
|---|---|
| A word in the summary | summary ~ "invoice" |
| An exact phrase | summary ~ "\"payment failed\"" |
| An exact phrase anywhere, open work only | text ~ "\"connection reset\"" AND statusCategory != Done |
| Words starting with a prefix | summary ~ "deploy*" |
| A single-character wildcard | summary ~ "log?n" |
| Similar spellings (fuzzy) | summary ~ "timeout~" |
| Open work mentioning a word in the description | description ~ "login" AND statusCategory != Done |
| A word in any comment | comment ~ "workaround" |
| Summary does not contain a word | summary !~ "test" |
| Newest matches first | text ~ "cache" ORDER BY updated DESC |
The inner quotes of a phrase must be escaped with a backslash, exactly as shown. Without them, summary ~ "api timeout" matches both words in any order, the same as summary ~ "api" AND summary ~ "timeout".
What fails, and the exact error
- Leading wildcards.
summary ~ "*ment"fails with "The text query '*ment' for field 'summary' is not valid: the '*' and '?' are not allowed as first character in wildcard query." Wildcards only work at the end or in the middle of a word. - Exact match on summary.
summary = "login"fails with "The operator '=' is not supported by the 'summary' field." Text fields only take~and!~. - Contains on labels.
labels ~ "urgent"fails with "The operator '~' is not supported by the 'labels' field." Labels are exact values; uselabels = urgentorlabels in (urgent, p1).
Notes
- No substring search. Matching is by word, so searching the middle of a word will not find it. Search the whole word, or its start with a trailing
*. - Custom text fields take the same
~and!~operators, using the field's name in quotes.
Want the rest? The Jira Cloud JQL Cookbook has 66 copy-paste queries for triage, sprints, releases, SLAs and reporting, each one validated on Jira Cloud. Get it on Gumroad, pay what you want from $12.