Searching an issue which matches exactly the given words.

Mohit Gupta
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 9, 2012

Hello,

I was searching some issues in JIRA by applying a filter and I provided three words in the Query field lets say that ( JIRA is good).

When I hit search, I am getting result based on all the words like the Summary conatining only JIRA is also coming in search result and Summary containing only good is also coming in search result, but what I want is the search result which contains only those with Summary containing all of the above three words in combination.

According to me, Summary should contain only search result with above three words at any place any order

What query should I apply to achieve this result.

Thanks

Mohit

14 answers

19 votes
JB
Contributor
October 9, 2018

Please Atlassian give us a method for >>exact<< searches.      Thank you.

13 votes
Norman Abramovitz
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 9, 2012

Grigory's response gave me another thought on how to make it work. Please try

summary ~ "\"Jira is good\""

The escaped inner quotes contains the search term while the outer quotes deals with the navigator syntax.

Orion Elenzil
Contributor
August 13, 2018

lots of up-votes for this answer, but i still just get tickets with "Jira" and also "good" but not "Jira is good".

Like # people like this
Olap
Contributor
December 18, 2018

Yeah, not sure what the up-votes for. This doesn't solve the issue at all.

Like # people like this
Ernesto Portillo October 11, 2019

I'm not sure why it did not work for you, but it seems to have worked for me.

I hope you found a solution.

Nikola Bornová February 18, 2020

It works on Jira Server v8.3.2, thank you.

Justin Bowen
Contributor
February 18, 2020

Thanks to everyone who is investing time in this. The above suggestion doesn't work for me, but even if it did, why is it expected that the user would need to research the proper syntax for escaping the quotes and using a tilde to perform a simple text search? Advanced syntax should be for instances where you need to search for things like a special character inside of a comment. 99.9% of the time people just need to search plain language phrases so they can locate the ticket or comment that contains the details they're looking for.

Like # people like this
Tom
Contributor
February 18, 2020

I could not agree more.

This is a very basic functionality that should have been there all along.

Like # people like this
Olap
Contributor
February 18, 2020

Atlassian is too busy shifting the UI from side to side and hiding needed functionality to actually solve our issues. What's new?

Like # people like this
Jawann
Contributor
May 7, 2020

Really wish this was available.

Like # people like this
Charles Jamison
Contributor
June 10, 2021

LOL.

 

I am just leaving "LOL" comments now.  After the UI downgrade we got that looks better but is functionally worse, I have zero hope that Atlassian reads these messages much less makes it easy for a user to search for a specific phrase like "JIRA NEEDS A NEW CEO".

Like Olap likes this
Olap
Contributor
June 10, 2021

Lycos search 1995 > Jira search 2021

Like Charles Jamison likes this
7 votes
Justin Bowen
Contributor
August 12, 2019

I can't believe that it's possible for Atlassian to have raised $462 million in their IPO 4 years ago and yet Jira still doesn't have a working (nevermind simple/common sense) exact phrase search. Am I just missing something...? Was there $10k in the budget to get this working? I'm sure more than $10k worth of clients would appreciate it.

3 votes
Sandra Kawamoto
Contributor
February 18, 2020

It is a known issue with Jira Cloud. They are gathering interest. Please, vote and comment if you are interested in this fix/implementation.

https://jira.atlassian.com/browse/JRACLOUD-21372

https://jira.atlassian.com/browse/JRACLOUD-69263

2 votes
Tom
Contributor
January 17, 2020

The funny part is that it does not even take a multiple word scenario to cause it..

 

Searching for "summary ~ "FT#3" 

matches a description "FT#4 for server number 3"

 

Even if you use all of the clever quote escaping above it still matches.  So I cannot even query for a simple one word phrase

2 votes
Doğucan Baskın November 27, 2019

So Atlassian is providing a solution which does not work. Isn't it a bug actually?

Olap
Contributor
November 27, 2019

No, that's normal state of affairs.

Ernesto Portillo November 27, 2019

try this, I think I have gotten this to work sort of.

summary ~ \"jira\ is\ ok\ I\ guess\"

Escaping the quotes, and escaping spaces.

Doğucan Baskın November 27, 2019

So for the comments that includes "You can close" should be:

comment~ \"You\ can\ close\"

This one giving me the same result with comment~ "You can close". :( 

2 votes
Ford Prior
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 28, 2019

Reading this thread is unbelievable. I honestly think whoever from Atlassian is replying still doesn't understand this issue being described.

2 votes
Balu March 14, 2019

for me this worked:

text ~ "\"Jira is good\"~0"

Joel Marriott
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 27, 2019

Would just like to upvote this working answer. (v7.3.2)

Olap
Contributor
March 27, 2019

Maybe it works for Server, for Cloud it doesn't work. The result is an "All the strings" result but no Exact Match.

Like # people like this
JB
Contributor
March 27, 2019

I just retested Cloud on the off chance that something has changed.    This solution is still equivalent to 

  • text ~ Jira and text ~ good

which returns all issues with both the word Jira in them and the word good in them, rather than only issues with the exact text "Jira is good" in them.

This isn't what the OP (& the rest of us) is asking for at all.

Joel Marriott
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 27, 2019

Shame that it doesn't work on cloud.

Can confirm it works on server though! Didn't realise OP was specifically asking about the Cloud version & odd that it doesn't function in the same way.

(This is assuming you've included the important ~0 bit)

JB
Contributor
March 27, 2019

Roger that, I included the ~0 bit.

I'm guessing that some admins have disabled word stemming leading to different end user experiences (see the bottom of https://confluence.atlassian.com/jiracorecloud/search-syntax-for-text-fields-765593720.html for Cloud or https://confluence.atlassian.com/jiracoreserver/search-syntax-for-text-fields-939937723.html  for Server)

I just tested this on my Cloud instance by setting indexing to other.  It's better but it's still not an exact match.     For example:

  • text ~ "\"Jira is good\"~0"

still matches the phrase

  • jira is extra good

even though it's not an exact match.

I'm guessing that server will have the same "extra" matches as well.   Perhaps someone can test this?

The bad part about this partial solution is that it affects all users and all searches, rather than letting the individuals searches declare if they need stemmed matching or exact matching.

Olap
Contributor
March 27, 2019

Amazing how Atlassian fails to provide basic search capability users have come to expect from search engines for the last 20 years.

Orion Elenzil
Contributor
March 27, 2019

this suggestion was so exciting that despite folks saying it doesn't work on cloud i had to try it myself. .. and confirming that w/ my cloud jira, these yield identical results:

text ~ "\"jira is good\"~0"
text ~ "jira is good"
Like Alexey Miroshnikov likes this
Orion Elenzil
Contributor
March 27, 2019

diving in a little further.

it seems that "proximity searches" are not working as documented,
at least in jira cloud.

specifically, i created a test ticket who's description is:

test jira search.

jira versus exact phrasing.

yep.

and then do an advanced search with:

 text ~ "\"jira phrasing\"~0"

which yields the test ticket, when it shouldn't.

same results with ~1, which also shouldn't match "jira versus exact phrasing".

text ~ "\"jira phrasing\"~1"

 

Like Pavel Savchenko likes this
2 votes
Orion Elenzil
Contributor
August 13, 2018

users to atlassian...

2 votes
Norman Abramovitz
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 9, 2012

See if this works for you.

summary ~ JIRA AND summary ~ is AND summary ~ good

Norman Abramovitz
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 9, 2012

You probably need double quotes around the word is since is an operator as well.

Norman Abramovitz
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 9, 2012

Oh, the default search indices has an ignore word list, so the word "is" may not match.

Tom
Contributor
January 17, 2020

That would still produce a match for the phrases:

 

"Good is Jira"

"Nothing is good about Jira"

"Jira needs To fix this for good because it is annoying"

Like # people like this
0 votes
Steve D
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 4, 2021

I stumbled on a similar problem today and found something that works for me.

A basic search on:

"\"Exact Text To Match\""

with the surrounding quotes included will produce results with only the tickets that contain the text 'Exact Text To Match'.

This can then be translated to the following, rather chaotic, advanced search condition:

text ~ "\"\\\"Exact Text To Match\\\"\""

 

Jawann
Contributor
February 11, 2021

Hmmm doesn't work for me in Jira Cloud. I get the same number of results as a simple text search with no quotes or anything.

Steve D
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 17, 2021

We are running JIRA server v7.2.2. I don't use cloud, so I am not sure if this difference is between the server and cloud implementations of if something changed in a newer release, as our version is over 4 years old at this point...

0 votes
Jordan Nimlos
Contributor
November 23, 2020

I, too, find it very frustrating that there is not a better way to do an exact search on text fields in JQL.  I have a use-case for this where I need to make sure my JQL query returns only 1 issue as I know there is only one where the summary exactly matches my search term, with no extra terms outside of that. I tried things that others suggested here, like:

summary ~ "\"Sample text\" NOT \"Sample\ text\ *\""

and

summary ~ "+\"Sample\ text\" -\"\ *\"~0"

but nothing works.  It either returns nothing, or it returns my desired issue and other issues with summaries like "Sample text abc".

After banging my head against the virtual wall for a while this morning I remembered that Scriptrunner has an issueFieldExactMatch() function built-in.  I just tried it out and it worked beautifully, no special syntax or escaped characters required.  You can use

issueFunction in issueFieldExactMatch('<some JQL subquery>', 'summary', 'Sample text')

Specific documentation on usage here.  I agree that Atlassian should provide a better way to do exact search on text fields and that it is ridiculous that they have not yet done so. However, Scriptrunner is quickly becoming my favorite add-on and it is one of the more affordable plugins out there, arguably one of the best value for the money for how powerful I've found it to be.

If your workflow depends on an exact text field match, I suggest looking into that.

Alexey Miroshnikov
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 23, 2020

Sounds promising, but I personally get

"Field 'issueFunction' does not exist or you do not have permission to view it."

error message in cloud Jira.

Like Arkadiusz Robiński likes this
Jordan Nimlos
Contributor
November 24, 2020

If you have Scriptrunner for Jira Cloud, it looks like this is still possible but you may have to enable "enhanced searching" to use issueFunction: https://scriptrunner-docs.connect.adaptavist.com/jiracloud/enhanced-search.html#_issuefieldexactmatch 

0 votes
Pete Smith
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 11, 2019

Can I force a search to be case-sensitive? That would get me a bit closer to my target

0 votes
grundic
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 9, 2012
summary ~ "JIRA is good"

As Norman said, you have to use double quotes to search exact phrase.

Norman Abramovitz
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 9, 2012

Does that actually work for you? I have tried it out since version 4.4 (when I started to use JIRA)and it generates results more like field contains word1 or field contains word2 or field contains word3 which is the behavior that Mohit was complaining about.

The reason for questiong, is because maybe there is an option that people can turn on.

grundic
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 11, 2012

My bad - I was wrong. According docs you have to use fuzzy search to get exact match like this:

summary ~ "\"JIRA is good\""

Double quotes inside query have to be escaped.

Sorry for incorrect answer at first.

Hope, this helps.

dibenedetto
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 3, 2017

This doesn't work. Try a two-word phrase with a freshly created issue. I'm getting hundreds of results when I should only be getting 1.

Peter Morgan
Contributor
October 29, 2018

Normally I don't post "ME TOO!" but this question has been open since 2012 and the answers only echo the Jira documentation description ~ "\"match this exact phrase\""
This does not work for me and obviously not for some other users.

Does something have to be explicitly configured to make this work?

Like # people like this
Alexey Miroshnikov
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 14, 2019

Can only confirm that (at least, without any special configurations) now in cloud Jira the description ~ "\"match this exact phrase\"" approach doesn't lead to the desired result.

Like # people like this
Ed Malcolm
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 5, 2019

Come on Atlassian- get off your asses and at least reply to this

Like Olap likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events