Forums

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

JQL search for string that contains a dash "-"

Kyle Thureen August 19, 2021

I need to be able to search a paragraph text field in Jira issues for strings that contain a "-" character and a wildcard.  For example:

If I have three issues where the text field contains:

  • "ABC-DEF-G"
  • "ABC-DEF-H"
  • "ABC-DEF-I"
  • "ABC-DEF-...."

I want a single JQL search to return all issues that have text matching that "ABC-DEF-*" pattern

This search returns nothing, when I know there are issues that match in my project:

<my paragraph text field> ~ "ABC-DEF-*"

Search syntax for text fields | Jira Software Data Center and Server 8.18 | Atlassian Documentation says that "-" is a Special Character that is not indexed.  Does that mean I can't search for strings that contain "-" characters using wildcards? 

3 answers

1 vote
Daniel Turczanski - JQL Search Extensions
Atlassian Partner
August 24, 2021

Hi @Kyle Thureen ,

As others have pointed out, standard JQL doesn't easily allow to search for a text with special characters.

You may consider using our professional indexing service:


After you install the app you can simply search:

issue in wildcardMatch("summary", "ABC-DEF-*")

Check out the docs for more information.


I hope this helps!
Daniel

1 vote
Payne
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.
August 19, 2021

This is a bit of a hack and something you probably don't want to do too often, but if you just need to run it once or occasionally, it might fit your needs. First, execute a JQL statement to get your result set as small as you can (e.g. project = BLAH and created >= startOfYear() ) and then export the resulting issues to CSV. Open them with Excel, etc. and add a column that references your field of interest with a function like =IF(FIND("-",A2)>0,1,0) Sort the rows by that column, and you'll then have all of your issues of interest grouped together.

0 votes
Fabian Lim
Community Champion
August 19, 2021

Hi @Kyle Thureen

The disclaimer for this functionality is that the field you are researching on must allow you to use the "~" operator. Your search will work in Summary and description which are system fields, but from my experience you can't search on any other multi text or single text custom fields.

Take a look at this: https://support.atlassian.com/jira-software-cloud/docs/advanced-search-reference-jql-fields/

Cheers

Suggest an answer

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

Atlassian Community Events