Problem with search queries and NOT


#1

I have 2 diffrent searches:

this one works, it shows open tickets that have set the CustomField “Kategorie” to the value “Datenschutz”

Queue = ‘community’ AND ( Status = ‘new’ OR Status = ‘open’ ) AND CF.{Kategorie} LIKE ‘Datenschutz’

this one is the problem, it should show only the tickets that are not set to “Datenschutz” BUT it shows ALL Tickets in the queue (with open or new Status) also tickets which are set to “Datenschutz”:

Queue = ‘community’ AND ( Status = ‘new’ OR Status = ‘open’ ) AND CF.{Kategorie} NOT LIKE ‘Datenschutz’

any idea why the last one is not working ?

the custom field is set to Type: select one value, Render type: Select box, Applies to: Tickets, assigned to queue “community” (and 3 others)


#2

NOT LIKE includes ones with no values. You probably want something more like

Queue = ‘community’ AND ( Status = ‘new’ OR Status = ‘open’ ) AND ( CF.{Kategorie} NOT LIKE ‘Datenschutz’ AND CF.{Kategorie} NOT NULL )


#3

no actually i want all tickets except the ones with ‘Datenschutz’
but i still get them as result.


#4

this is user hast the same issue:

looks like it is a bug


#5

What version of RT do you have, I’ve done a test with version 4.4.3 and the query works correctly, I recommend you upgrade to a newer version.


#6

so even sth like CF.{bar} != 'X’ works correctly ? it only happens with custom fields and negation. “=” works normaly. also “NOT LIKE” doesnt work.

i will try to update thx, but its not that old, version 4.4.1.