Reputation: 76
I couldn't get jql to work properly in jira (my version: v.7.6.5)
Say if I have a field named location
and here's the value for the location field:
Seattle - East
And when I search in jql with query:
location ~ "Seattle - East"
nothing would come back.
Can anyone help with searching string with special characters such as -
or &
?
ps. I've read documents from Atlassian to escape characters with \
and \\
it doesn't seem to work well with &
Upvotes: 2
Views: 12931
Reputation: 965
I'm guessing that you're searching a custom text field named Location based on the operator.
The search location ~ "Seattle - East"
is searching for values that contain Seattle and do not contain East.
To search for an exact phrase you confusingly need to have a nested set of double quotes: location ~ "\"Seattle - East\""
I'm pretty sure that even in that scenario Jira will just ignore the -
.
Note that if you want more reliable reporting out of a custom field, a select list might be a better fit for a fixed number of location options. Then you could do a search like location = "Seattle - East"
Upvotes: 7
Reputation: 4647
As per the Atlassian documentation for Special characters, only space (' ') is listed but not both -
or &
.
The remedy as suggested by Atlassian JIRA is perfectly apt, escaping the space in the advised location (Seattle - East) should resolve the issue.
NOTE: When I'm trying to create labels or Projects with spaces, it doesn't even allow me to create one.
Creating a label called Super Man
creates two labels Super
,Man
Hope this helps.
Upvotes: -1