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

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 Join to answer
Community showcase
Jason Wong
Published yesterday in Agility Beta

Welcome to agility

Every team in the world is unique, and so   Atlassian believes   that each and every team's best way of working  needs to  be molded to their unique circumstances  – ...

391 views 6 16
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot