searching for "-" give error: Unable to parse the text '-' for field '.

Mikkel Kragelund Nielsen
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 5, 2013

Hey

Im trying to search for "-" in a custom text field. But this just resolves in a error:

Search: <custom text field> ~ "-"

Result: Unable to parse the text '-' for field '<custom text field>.


Can anyone help me. Th eproblem is that this is a mandotory field. But sometimes users just put "-".
I now want to find these issues.

1 answer

1 vote
Teck-En
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 5, 2013

"-" is a special character and you would need to escape it using a backslash. You can try the search with "\-" instead.

For more information, you can refer to this section of documentation: https://confluence.atlassian.com/display/JIRA/Performing+Text+Searches#PerformingTextSearches-Escapingspecialcharacters:\or\\

Mikkel Kragelund Nielsen
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 6, 2013

"\-" gives me this error:

Error in the JQL Query: '\-' is an illegal JQL escape sequence. The valid escape sequences are \', \", \t, \n, \r, \\, '\ ' and \uXXXX. (line 1, character 26)

Dave Hergert November 21, 2014

Per the documentation that was linked to, when doing advanced search you need to use two slashes, i.e. column ~ "\\-"

Nha Huynh April 26, 2019

 ~ "\\-" gives me "No issues were found to match your search"

stephanie.poorman September 30, 2019

Well, I - unfortunately - found the answer: 

Special characters

+ - & | ! ( ) { } [ ] ^ ~ * ? \ :

Special characters aren’t stored in the index, which means you can’t search for them. The index only keeps text and numbers, so searching for “\\[JIRA Software\\]” and “JIRA Software” will have the same effect — escaped special characters ([]) will be ignored in the search. 

You can use special characters to combine two separate terms into a phrase. Adding a special character between the terms, like in “JIRA+Software” or “JIRA/Software” will return issues that contain the whole phrase “JIRA Software”.

Suggest an answer

Log in or Sign up to answer