Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Controlling precision in "!~" filters/queries

Angelique_Moon
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!
April 9, 2020

I'm trying to filter a Customer attribute that supports !~ operator.  I want to filter out issues where the Customer contains "Internal" so as to only get to true Customer issues.  These issues are imported into Jira from another system where Customer is a required attribute, so if it's not an actual customer issue it is created with a variant on "Internal" as customer name.  There are a few different "Internal" customers that issues are generated against, but that term is present in all non-customer issues.

My problem is that including "customer !~ "INTERNAL"" in my query is also excluding any customers with "International" within the name.  How can I make the !~ either only exclude items matching the ENTIRE word "Internal" or pick the specific customer values that I'm trying to exclude?  ("!=" and "not in" are not valid syntax for this attribute.  It only supports ~, !~, is, and is not.)

1 answer

0 votes
Ste Wright
Community Champion
April 9, 2020

Hi @Angelique_Moon

To search via exact values, you'd need to change the type of field you use for customer - for example, using a field such as Select List (Single Choice) or a custom Labels field.

If you're using a free-text field you do have to use fuzzy matching - although I don't find the issue in regards to "Internal" and "International" applies to our instance when using...

summary !~ "internal"

...it only happens if we use * in the query - eg.

summary != "interna*l"

You could build up a set of includes and excludes in a query based on customer names and words to exclude - you can see more on how to use fuzzy matching and exact searching to achieve this on this page.

This is quite complex though and still might not solve the issue for customers with "Internal" in their name. Alternatively, you could use an app for more exact searching in a text field - such as ScriptRunner 

For example, I can search for all summaries which do not include the phrase "Internal" specifically - this means "Internal Story" would still appear even though it includes the word "Internal" - see:

issueFunction not in issueFieldExactMatch("project = ABC","summary","Internal")

Ste

Suggest an answer

Log in or Sign up to answer