I have a situation where some issues in a project have a custom field, while others do not. If I perform a search like:
project = FOO and customField is EMPTY
This will only return the issues that have the custom field "customField" and where the field is empty, it will exclude all issues that aren't associated with the custom field "customField"
I'm trying to execute a query that will return all issues where either the custom field is empty, or where the custom field is not associated with the issue. Is there a way to do this?
I've found the solution, but it's really hack-ish.
customField IS EMPTY and
customField IS NOT EMPTY does not return tickets that have no
customField at all. So, basically,
NOT (customField IS EMPTY OR customField IS NOT EMPTY) should return them. As it turns out, it doesn't. Probably some pre-processing of query etc. But if you save it as a filter, it works. So..
customField IS EMPTY OR customField IS NOT EMPTY
NOT filter = "Has customField", you get issues that have no customField at all
project = FOO and (customField is EMPTY OR NOT filter = "Has customField")
Script Runer allows implement straigtforward solution with the only JQL query
project = FOO and issueFunction not in expression("project = FOO and (customField IS EMPTY OR customField IS NOT EMPTY)", "created <= today")
It's also slightly hackish, since expression always means "all issues from subquery", but at least it could be done via scripting w/o filter being saved
I've also tried a direct query via jira-cli and I also get an error:
jira-cli view --search-jql 'project = Development AND NOT (team IS EMPTY OR team IS NOT EMPTY)'
Please check <a href="https://status.atlassian.com">Atlassian Status</a> for any known issues.
If your page hasn't appeared again in 5-10 minutes, please contact our support team.
<a href="https://status.atlassian.com" class="aui-button aui-button-primary" style="width: 175px;">
<a href="https://getsupport.atlassian.com/servicedesk/customer/jst" class="aui-button">
I am also facing this issue while I do jql for Component field in a project.
Search1 : project= proj1 and "component" is not EMPTY
Search2 : project= proj1 and "component" is EMPTY
Search3 : project= proj1
Search3 is not equal to some of Search1 and Search2.
I second that. The "custom field" is EMPTY does not always work. I think this is a bug in JIRA (mine is 7.0).
I tried to reindex search, but it did not help.
This is somehow related to a situation where you have two or more projects with same set of custom controls. E.g. prj1 contains "custom field" and prj2 also contains "custom field".
The correct jql should be the following:
project=prj1 and cf is EMPTY
, where 10201 is the id of your custom field (you may quess it if you add a search column with your CF value and inspect corresponding html code).
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
We're bringing product updates and pro tips on teamwork to ten cities around the world.Save your spot