Forums

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

What is the difference between JQL "EMPTY" and "NULL" Keywords?

Edward Snowden July 3, 2018

I am wondering if someone could help me understand the difference between "EMPTY" and "NULL" keywords and where exactly to use them.

For example all these work for me and show the same result:

project = "Test Project" and assignee is null
project = "Test Project" and assignee = null
project = "Test Project" and assignee is empty
project = "Test Project" and assignee = empty

Where my assignee column shows "unassigned".

Thanks

3 answers

5 votes
Joe Pitt
Community Champion
July 3, 2018

It appears JQL treats null and empty the same way. 

NULL is special in databases. Use Null if the entry has never been used/set. I don't know if  the assignee field is initially NULL when it shows Unassigned or empty. 

Empty IS allocated to a memory location, although the value stored in the memory is not set.

NULL isn't allocated any memory, the string with NULL value is just a pointer which is pointing to nowhere in memory. however, JIRA shows the red Unresolved when the resolution field is NULL and the only way to remove the resolution value is to 'clear' the field with a post function. 

2 votes
Pete Singleton
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.
July 3, 2018

In JQL terms NULL and EMPTY behave the same way, as does your use of '=' and 'is'.

Rob Horan
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 12, 2020

((tearing my hair out))

This casual non-conforming syntax is the kind of thing that makes being prepared for these certs near impossible.

Like # people like this
1 vote
Tousif Shaikh July 3, 2018

In JQL, I had seen that empty has different meaning in terms of fetching contents for assignee and version attributes.  In case  assignee or version is not updated on Jira issue Jira would consider as empty and would return same results in JQL.

Since empty is considered as blank in case anyone update JQL with null jira won't be able to search for a issue in Jira.

Hope that it would clarify your doubt.

Thank you,

Tousif Shaikh.

Edward Snowden July 3, 2018

How can someone update it to null? for example I tried to update the assignee field to null but it won't accept this. Can you provide some examples to help me understand?

Thanks for responding though!

Nic Brough -Adaptavist-
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.
July 3, 2018

The assignee is a system field and handles null differently to custom fields.  An empty custom field has no line in the custom field value table, whereas (most) system fields are represented by a "null" in the database field for them on the issue table. 

A null in assignee is selected by, and represented by, the word "unassigned" in the UI.

Like Kris likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events