Empty label field not working as expected

Ivo Noort September 18, 2019

Hello,

 

I want to exclude succeeded backup notification tickets from different sources from the 'All open" filter queue.

I add the label 'backup' to tickets from certain sources with different triggers through automation and list it in it's own 'backup reports' queue.

But when I want to exclude them from the all open queue an empty label field does not trigger the "labels != backup" criteria.
Why not?

This is the JQL filter.
resolution = Unresolved AND labels != backup ORDER BY created ASC

2 answers

1 accepted

1 vote
Answer accepted
Ilya Turov
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 18, 2019

Hello,

thats how JQL works, you need to search for empty labels as well like this:

resolution = Unresolved AND (labels != backup or labels is empty) ORDER BY created ASC

Ivo Noort September 18, 2019

Thanks for educating me on JQL Ilya it works now! 👍🏻

0 votes
Keith Robertson August 28, 2023

Instead of

labels != backup

labels not in (backup, authorization)

use

# Select ticket if missing the named label.
NOT (labels = backup)

# Select ticket if missing ANY of the named labels.
NOT (labels = backup AND labels = authorization)

# Select ticket only if missing ALL of the named labels.
NOT (labels in (backup, authorization))

These avoid having to check whether labels IS EMPTY.

Your filter therefore becomes:

resolution = Unresolved AND NOT (labels = backup) ORDER BY created ASC

Suggest an answer

Log in or Sign up to answer