Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,556,415
Community Members
 
Community Events
184
Community Groups

How to search for issues with an empty field (Issue Picker)?

Hi,

I have a field of type Issue Picker.

What is correct JQL query to find issues where my field is not populated?

Unfortunately "FIELD is Empty" doesn't work as Jira/ScriptRunner does not support searching for EMPTY values for issue picker.

2 answers

1 accepted

0 votes
Answer accepted
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Sep 05, 2019

There is no way to do this I'm afraid.  It's a quirk of the search system in Jira and how it makes custom field plugins work - to enable the sub-set search for the issue picker, the code has to tell Jira the field is always populated, even when it's not (this is a terrible explanation, but I don't know how else to keep it simple)

How can we then search for issues with empty issue picker fields atm? Also a Scriptrunner Number Field doesn't seem to work in a JQL query (scriptRunnerNumberField = 0 returns all results, including such where the numer is other than zero).

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jun 15, 2020

You can't.  The issue picker field does not allow for it.

I'm not sure about the number field though, I don't get that, field = 0 returns issues where it's 0 to me.

Interesting. I got it to work using the following trick:

issueFunction in issueFieldMatch("", IssuePickerFieldName, "^$")

And yes, I also don't get what's wrong with the Number field. field = 0 returns issues where its 1 also. The searcher is set to Number Searcher, the template is Template Field. The code has only two exit points: return 0 at one place, return 1 at the other branch of execution.

Like Joey Musante likes this
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jun 16, 2020

Change the template to number, that should fix the field.

Only "Number field" exists in the drop down. I am not sure I know what you mean.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jun 16, 2020

This is a Scriptrunner scripted field isn't it?  When you configure it, you get a big box for the script and then a select list for template underneath it?

Exactly. However, the template is called "Number field", not "Number". And it turns out that it usually works, but after a change of an issue which changes the number, and re-querying, the result of the query doesn't change, even though it should. Maybe some caching issue? I'll continue observing it, and when I have a working repro I'll write again.

I reindexed Jira and was able to search on Empty single user picker field. Before reindexing I was unable to search.

 

I believe this is the correct answer.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events