Recently, I hit a wierdness in a JIRA filter that did not return all issues I expected. After some testing and dialog with Atlassian - in short - a bug report was created and shortly closed by Atlassian with the comment:
Hello all,
This kind of behaviour is present for multiple JQL cases e.g. custom fields, labels, projects and is an expected, designed behaviour hence this issue will not be considered a bug.
Cheers,
Pawel, Jira Developer
In short, this is regarding customefields (etc) that can be empty (as having a null value in the database) - typically represented as "none" is a select field or blank in a string.
To sum up, if You are searching a project and You JQL has some "not in" or "!=" operation, be sure to add a phrase for EMPTY:
PROJECT = CUSTOMER1
will return all issues, where as
PROJECT = CUSTOMER1 AND Classification not in ("Patch Management")
needs to be written as
PROJECT = CUSTOMER1 AND (Classification not in ("Patch Management") OR classification is empty)
to actually show all issues.
So It seems for every negation on fields and labels etc in Your JQL, EMPTY need to be taken in account also.