Why does the JQL contains operator (~) on description field Return Non-Matches?

Tommy Augustine June 2, 2022

Hi, 

I have a user trying who is running a JQL query similar to the one below, and it returns 121 Issues it says contains the search string, but many of the 121 issues do not have the actual search string in them. Anybody have an idea why it's doing this?

Syntax used: 
Description ~ "When going to the golf tab"

Thanks in Advance!

2 answers

2 accepted

2 votes
Answer accepted
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 2, 2022

I suspect it's because ~ is actually a fuzzy search, not an exact one.

If you could give us some text that you think it should not have matched, we may be able to explain!

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 2, 2022

Hi @Tommy Augustine 

Yes, and...to Nic's answer, when you want an exact phrase match, you need to escape an extra set of quotation marks, as shown here:

https://support.atlassian.com/jira-software-cloud/docs/advanced-search-reference-jql-operators/#Advancedsearchingoperatorsreference-CONTAINS-CONTAINS--

Kind regards,
Bill

Like Tommy Augustine likes this
Tommy Augustine June 3, 2022

  Thank you guys for the additional help!

Like Bill Sheboy likes this
0 votes
Answer accepted
Tommy Augustine June 7, 2022

Sharing Official Answer from a high-speed Atlassian Support Engineer:

The Description field, along with many of the Jira text fields, leverage the tilde operator as a fuzzy search in order to pull results that are "about the same" as the query. However, in the example that you provided, we're also encountering a few words that are on the Reserved words list:

https://support.atlassian.com/jira-software-cloud/docs/search-syntax-for-text-fields/#Searchsyntaxfortextfields-reservedReservedwords 

If the other JQL query is attempting to leverage words from the Reserved words table, those words will be dropped and ignored from the final JQL query. In the example you provided, Jira will be searching for any issues with a Description field containing the words "going loan lab", since the words when, to, and the are reserved words.

This does make searching through text fields in Jira trickier, since the displayed results might not cover every word. We have an active Feature Request regarding exact JQL searches, and I'll link it below:

Allow exact-text searching in JQL: https://jira.atlassian.com/browse/JRACLOUD-21372

I'll also link this support ticket to the above Feature Request in order to track the impact and interest from you and your team.

==========================

In the comments for the above link, users do mention a workaround using a third-party Marketplace apps to perform an exact search on a Jira site:

JQL Search Extensions:  https://marketplace.atlassian.com/apps/1214791/jql-search-extensions-for-jira?hosting=cloud&tab=overview

==========================

Ideally, there should be a native function to perform JQL searches, but with the Feature Request above being the ultimate answer to including this functionality it's up to the developers to continue investigating this feature. For a more short-term solution, the JQL Search Extensions plugin above might help you and your team perform more direct searches through your Jira issues.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events