Forums

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

Search for an exact phrase with JQL

30 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

Slava Gefen
Contributor
December 17, 2024

Something isn't good with your settings, @Steven Lees-Smith .

First of all, this is a mistake

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

You'll get an error:

Capture3.PNG

But the wildcard with double quotes will give you only one result:

Capture4.PNG

And finally, usual wildcard will give you the result you mentioned:

Capture5.PNG

Hope it helps!

With kind regards
Slava

Comment

Log in or Sign up to comment
TAGS
atlassian, atlassian government cloud, fedramp, webinar, register for webinar, atlassian cloud webinar, fedramp moderate offering, work faster with cloud

Unlocking the future with Atlassian Government Cloud ☁️

Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.

Register Now
AUG Leaders

Atlassian Community Events