Like query operator in Jira's JQL

Josh Sherman
1 min read
Productivity

Jira’s query language (JQL) is a query language similar to SQL. That being said, the syntax for doing something similar to SQL’s LIKE statement is nothing like how you’d do it in SQL.

While deviating from the syntax that was used for inspiration isn’t uncommon, it’s quite peculiar that the word “LIKE” is also a reserved word in JQL, even if it’s not used explicitly for fuzzy matching.

In JQL, they refer to “like” statements as “contains”. The “contains” operator is the tilde ~ and looks something like this:

field ~ searchtext

The operator allegedly attempts to match on derivates so searching for “file” will also match “files”.

The operator also supports wild cards, and uses an asterisk * instead of SQL’s wild card characters:

field ~ "searchtext*"
field ~ "*searchtext"

If you are searching for a multiple word phrase, keep in mind that including a space in your search text implies “match BOTH of these words”:

field ~ "this that"

Which will search for “this” and “that”. If you’re looking for “this that”, you’ll need to quote (and escape) the string like this:

field ~ "\"this that\""

And if you’re looking for things that do not contain something, simply slap a bang ! on the operator:

field !~ searchtext
Join the Conversation

Good stuff? Want more?

Weekly emails about technology, development, and sometimes sauerkraut.

100% Fresh, Grade A Content, Never Spam.

About Josh

Husband. Father. Pug dad. Musician. Founder of Holiday API, Head of Engineering and Emoji Specialist at Mailshake, and author of the best damn Lorem Ipsum Library for PHP.

Currently Reading

Parasie Eve

Previous Reads

Buy Me a Coffee Become a Sponsor

Related Articles