Search for an exact phrase with JQL

29 comments

Akira Higuchi May 7, 2024

@Narsha Bachoo 

I tested the following JQL and got the same result.

text ~ "\"SCPR-\""

text ~ "\"SCPR\""

"-" is a special character, so I don't believe it is stored in the index. The documentation for the Data Center clearly states this, but the documentation for the Cloud has lost that mention. I don't know why.

Slava Gefen
Contributor
May 7, 2024

and yes I do have scriptrunner installed

@Narsha Bachoo that's great! 👍

In Data Ceneter we could use something like this:
Search syntax for text fields | Jira Software Data Center 9.15 | Atlassian Documentation

summary ~ "SPCR-*"

But it's deprecated in Cloud unfortunately
Search for issues using the text field | Jira Cloud | Atlassian Support

 

But then you can use this Script Runner Enhanced Search example:

issueFunction in issueFieldMatch("project IN (STAR, SD)", "summary", "^SPCR-*")

That will give you the same result in Cloud.
Here is my example with usual JQL

summary ~ "\"Sub-*\""

That gives all results with "Sub-" even not in the beginning:
Capture1.PNG

 

And here is the example of Script Runner function

issueFunction in issueFieldMatch("project IN (STAR, SD)", "summary", "^Sub-*")

That gives the desired result:

Capture2.PNG

Documentation is here:
JQL Functions (adaptavist.com)

Hope it helps!

With kind regards
Slava

Narsha Bachoo May 7, 2024

Hi @Akira Higuchi

Thanks but it is not working for me. I am not getting the expected results.

Hi @Slava Gefen

This is working as expected in scriptrunner. Thanks for your help!

Regards,

Narsha

Like Slava Gefen likes this
Steven Lees-Smith November 13, 2024

This just doesn't work but it is still included in the Atlassian official doco.

The exact phrase match still just seems to work as a wild card search.

summary = "\"This is a test\""

Will return

This is a test

This is another test

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events