Text search exact phrase with reserved keywords

I wonder about text search capabilities in JIRA. I have read the
documentation regarding this, I know that there are some reserved keywords like
'and', 'not', 'will' etc.
Also, it should be possible to query for an exact phrase by enclosing
the phrase in double quotes and the reserved keywords in single/double quotes.
E.g "Terms 'and' conditions" should return issues with the exact phrase Terms and conditions,
but it results in an error. "Terms and conditions" will remove 'and' from the search
and return issues containing both words.
Do you have any ideas about this? Thank you.

2 answers

1 accepted

1 vote
Accepted answer

if you want to search for "Terms and Condition" use

~"\"Terms and Condition\""

That will remove the keyword 'and' actually and return > 1 issues. The result I expect is either

exactly == 1 issue, or zero if the issue with that exact summary doesn't exist.

Funny, I was 100% I tried that (that's why I linked to the documentation).

Sometimes it takes a second person to clear things up :).

Edit: Ok now I realised, the search yields different results if Conditions has a trailing s or not. I'm starting to think about stemming here.

~"\"Terms and conditions\"" will return > 1 issues. Each one having the phrase in it. E.g

xxxx terms and conditions

terms and conditions xxxx

xxxx terms and conditions xxx

How can I limit to only the exact phrase without surrounding words?

The CONTAINS operator (~) does what it should: it shows issues that contains a certain phrase. So no solution out of the box.

Not sure if it works with script runner plugin there is a JQL function issueFieldExactMatch which could fit your needs. But I haven't tried this function yet.

Using the REST API when the key is unknown, this method will yield unexpected results unfortunately. But I understand, if ithat's how the CONTAINS work, there's not much to do.

Is the only option to narrow down the results to use more fields?

summary ~"\"Terms and conditions\"" and summary!~"\" Terms and conditions \""

note the leading and trailing blanks in the second phrase

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Sunday in Feedback & Announcements

How do you analyze GC logs, thread dumps and head dumps?

Hi awesome community!  In this article, I would like to describe the one of the toolset (service) for the analyze some problems on different Java-based instances, of course, as Atlassian admini...

124 views 0 8
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you