JQL filter for "custom field is not EMPTY" returns some wrong results

leogg January 15, 2020

We have project in Jira Cloud with a multi-line text custom field. When I search for issues that have that field not empty:

project = MYPROJ AND "My custom field" is not EMPTY

I get a some issues that, in fact, have an empty "My custom field" (about 9% of the total results).

Is anybody else seeing this behaviour? Can anybody suggest a workaround? 

I wonder whether this may be related to JRACLOUD-67435

 

3 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.
January 16, 2020

With text fields, it is possible to put data in them that looks empty.  You can test for this case by looking at the full issue view - is the field name displayed in the issue view?  If it is, then there is an invisible character in the field, so it is not really empty.

If the field name is not visible in view, then it is genuinely empty, and yes, the bug you mention is the most likely reason.

leogg January 17, 2020

Hi Nic,

Thank you for your answer. The custom field is genuinely empty in the affected issues: some are new unmodified issues (and we have no default value for the custom field), and I followed your advice and I can confirm that the field is not visible in the full issue view of the affected tickets (when using the old issue view, as empty fields are always visible in the new issue view).

So I guess it is a bug, how frustrating. I'll vote for JRACLOUD-67435.

Thanks again for your help.

0 votes
Amir Katz (Outseer)
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 26, 2021

It seems that the workaround suggested in the Jira Cloud ticket does not always work in server and I still get results with empty values.

What I have devised is not a general-purpose solution, but it's what I needed, and it may be useful for others.

Use Case

Export some custom fields values in order to import them into Jira Cloud.

This is because some custom fields are not migrated by Jira Cloud Migration Assistant (JCMA).

The output CSV files can have tens of thousands of rows.

Problems

1. Due to the empty rows problem, many rows in the generated CSV file have empty values in the relevant columns, so there's no point importing them to the destination (cloud) Jira.

2. The CSV import functionality (System --> External System Import --> CSV) cannot handle large CSV files, so the exported CSV file, if large, must be split into multiple, smaller CSV files.

Solution

I wrote a Python script to do the splitting. As part of the script parameters, I specify which columns in the CSV should be checked for empty values. Rows that have empty cells (null or whitespace) in ALL the specified columns are skipped and not written to the output CSV files.

Doing this kills two birds with one stone - skip empty values and split the CSV.

0 votes
Amir Katz (Outseer)
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 1, 2021

The same bug exists in Jira server.

I'm 100% sure that a similar workaround was suggested for it...

Can anyone locate that thread?

fredrik_folkeryd September 20, 2021

I also came across this bug in Jira server and successfully applied the workaround described in JRACLOUD-67435 above (even though that workaround does not explicitly mention Jira server). 

Suggest an answer

Log in or Sign up to answer