Searching issues with specific custom field option hit into NullPointerException

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Symptoms

Searching issues at Issue Navigator with a specific Custom Field value will have the following error:

1 2 3 4 5 6 7 8 9 10 11 12 13 java.lang.NullPointerException at com.atlassian.jira.issue.customfields.manager.DefaultOptionsManager.findByOptionValue(DefaultOptionsManager.java:164) at com.atlassian.jira.issue.customfields.manager.CachedOptionsManager.findByOptionValue(CachedOptionsManager.java:95) at com.atlassian.jira.jql.util.JqlSelectOptionsUtil.getOptionFromString(JqlSelectOptionsUtil.java:208) at com.atlassian.jira.jql.util.JqlSelectOptionsUtil.getOptions(JqlSelectOptionsUtil.java:135) at com.atlassian.jira.jql.context.SelectCustomFieldClauseContextFactory.getContextOptions(SelectCustomFieldClauseContextFactory.java:109) at com.atlassian.jira.jql.context.SelectCustomFieldClauseContextFactory.getClauseContext(SelectCustomFieldClauseContextFactory.java:68) at com.atlassian.jira.jql.context.MultiClauseDecoratorContextFactory.getClauseContext(MultiClauseDecoratorContextFactory.java:66) at com.atlassian.jira.jql.context.QueryContextVisitor.visit(QueryContextVisitor.java:134) at com.atlassian.jira.jql.context.QueryContextVisitor.visit(QueryContextVisitor.java:36) at com.atlassian.query.clause.TerminalClauseImpl.accept(TerminalClauseImpl.java:137) at com.atlassian.jira.jql.context.QueryContextVisitor.visit(QueryContextVisitor.java:80) at com.atlassian.jira.jql.context.QueryContextVisitor.visit(QueryContextVisitor.java:36)

Cause

One of the custom field options has a null value

Resolution

  1. Search for the null value in the database:

    1 SELECT cfname FROM customfield WHERE id IN (SELECT customfield FROM customfieldoption WHERE customvalue IS NULL)
  2. Remove that problematic Custom Field Option from the JIRA Administration page

  3. Persisting the issue, perform a Full Re-index and verify.

Updated on April 15, 2025

Still need help?

The Atlassian Community is here for you.