Searching issues with specific custom field option hit into NullPointerException

Still need help?

The Atlassian Community is here for you.

Ask the community

Symptoms

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

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:

    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.













Last modified on Jul 28, 2022

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.