JQL treats quesiton mark as wildcard it seems

Ionut-Dan Nica April 19, 2023

Hi,

 

I have a Jira instance where if I search with this syntax:

 

project=FOO and summary ~ '23.1 ? AF ? 8.0.0 ? egg ; 100 on inbox ; 200 on inbox' and issueType='Epic'

 

I get 2 results

'BC | AF | 8.0.0 | egg ; 100 on inbox ; 200 on inbox

and

ABC | AF | 8.0.0 | Dummy | egg ; 100 on inbox ; 200 on inbox

 

As per documentation the ? is supposed to mean a single character, why is it giving me the epic that contains the Dummy string also?

1 answer

1 vote
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.
April 19, 2023

Hi @Ionut-Dan Nica -- Welcome to the Atlassian Community!

When you search by enclosing the terms in quotation marks, it checks if all of the terms are present, in no particular order and with no exceptions for other words present.  When you want an exact match, please enclose the entire expression in escaped quotation marks, as described in this part of the documentation:

https://confluence.atlassian.com/jirasoftwareserver/search-syntax-for-text-fields-939938747.html#Searchsyntaxfortextfields-exactsearches

For example, 

text ~ "\"Jira Software\""

Kind regards,
Bill

Ionut-Dan Nica April 21, 2023

Hi Bill thanks for getting back to me.

I was perhaps incorrect in my problem statement, so the output is without single or double quotes the names have just the pipe as special character.

 

I have amended the question to better reflect this.

 

What stumps me is that if I rename the second story from

ABC | AF | 8.0.0 | Dummy | egg ; 100 on inbox ; 200 on inbox 

Into 

ABC | AF | 8.0.0 | Dummy - egg ; 100 on inbox ; 200 on inbox

 

So just changing the pipe into a dash, I get a single result, the first term, what I would expect.

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.
April 21, 2023

First thing, I am trying this on Jira Cloud and not Server/Data Center, so the wildcard behavior could be different.

The question mark (single character) wildcard appears to only have meaning under 2 conditions:

  1. when it is in the middle of a text string, such as: summary ~ "te?t", or 
  2. when searching for an exact text phrase, wrapped in escaped quotation marks, such as: summary ~ "\"test ? has a character in my list\""

I do not know what it means to search for any character (i.e., question mark operator) in a search without looking for an exact text phrase.  On Jira Cloud, such a search immediately errors with the following, regardless of where the question mark falls in the search: "...the '*' and '?' are not allowed as first character in wildcard query."

And, I am unclear why the hyphen would alter the behavior; I recall open defects in the public backlog about hyphen impacting searches.

Suggest an answer

Log in or Sign up to answer