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

This widget could not be displayed.

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?

This widget could not be displayed.

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
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted 11 hours ago in Canada

AUG Lunch Roundtable - August 13 - Highlights

Thanks to everyone who came out today for the lunch AUG - we had some great food and discussion (and ice cream sandwiches to fend off the heat!) The welcome and fun fact was great as well, what an aw...

27 views 1 3
View post

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