Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

JQL does not show correct results

Volodymyr
Contributor
September 1, 2021

My JQL:
project = CLPS AND issuetype = Opportunity AND status != Closed AND cf[16217] !~ "GBU/NA"
(The custom field has text type)
I need to find all issues that do not contain the values GBU/NA, GBU/NA*, but JQL shows all the issues w/ and w/o those values.

I've tried all the options that I found and only one works correctly, but does not fit my request (I know that it works backwards, but at least it's working):
project = CLPS AND issuetype = Opportunity AND status != Closed AND cf[16217] ~ "\"GBU/NA*\""

I also tried to follow the tips and workarounds that are available here or on the Atlassian website, like this one:
https://confluence.atlassian.com/jirakb/jql-queries-search-for-issues-that-do-not-contain-text-1018761257.html

Could someone help me to find how to search for a text that contains wildcards (namely / in it)?

1 answer

0 votes
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.
September 1, 2021

Hi @Volodymyr 

Full disclosure that I am currently using Cloud version and haven't used Server in a while...

Looks like the documentation still indicates that special characters like that are not stored in the index used for searching: https://confluence.atlassian.com/jiracoreserver073/search-syntax-for-text-fields-861257223.html#PerformingTextSearches-EscapingSpecialCharactersor

So your options may be:

  • simplify the query (if that works for your needs).  For example, ...cf[16217] !~ "GBUNA" AND cf[16217] !~ "GBU NA"
  • get as close as possible with a query, export the results, and perform the final search in another tool

Best regards,
Bill

Volodymyr
Contributor
September 2, 2021

@Bill Sheboy
Thank you for the answer and disclosure.
I've checked everything that I found, every single suggestion from Atlassian, ScriptRunner and it still doesn't work for some reason. The same field doesn't work for other projects as well.

If anyone find the same issue, check out articles below. Maybe it'll help you:
Search syntax for text fields | Jira Core Data Center and Server 7.3 | Atlassian Documentation
Advanced searching - operators reference | Jira Core Data Center and Server 7.3 | Atlassian Documentation
Apache Lucene - Query Parser Syntax


Suggest an answer

Log in or Sign up to answer