Sio I want an exact match when using the contains operator in a JQL query.
key = TEST-36 AND summary ~ "__SPU__"
However this seems to return anything with SPU also regardless of capitalization!
How to get an exact match?
Hi Timothy,
this is not possible with current Jira versions. There is an open issue for that:
https://jira.atlassian.com/browse/JRASERVER-21372
Maybe you want to vote for it.
sigh...
OK, well since I am calling it from script runner then I can use a regex to make sure it matches.
But it is really irritating that the issue referenced has been open for 7 years. This should be supported by JQL :-(
Thanks for the reply!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have the exact requirement. Timothy, can you please elaborate on "calling it from script runner".
Thanks,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Should not the accepted answer - took me unnecessary time to read everything here to finally find (at least for me) the working solution further down.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I love how this entire community is filled with posts that describe an issue, and they are all "solved" with the solution being "you can't do that".
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
seems like escape quotes work. summary ~ \"XYZ\"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As of Sep 2023 - there is "kind of" a solution for Jira Cloud:
use: summary ~ "\"search string\""
(described here: https://community.atlassian.com/t5/Jira-articles/Search-for-an-exact-phrase-with-JQL/ba-p/2131545)
How usable is this - is another topic. But at least there is a solution!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello everyone,
scriptrunner JQL function helped me solving that issue
issueFunction in issueFieldExactMatch(subquery, fieldname, regexp)
took from here
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have been reading documentation for days now trying to get scriptrunner setup. Any advice to help me get it working?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Joshua Hopkins ,
Yes see my screenshot :
In my case i use it in Jira Automation and it's working fine.
To help you, you can use the website https://regex101.com/ to construct your regex if you need more than an exact match. To have an exact match, just put your text between ^and $ as shown but with regex101.com you can construct more precise.
Is it clear for you?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can someone help me understand why this query returns 16 tickets (14 of which are an exact match), but the below scriptrunner query does not work?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.