Edit or Update Issue results in a NullPointerException
Symptoms
Performing an issue action results in this appearing at the top of the browser page:
Exception occurred: java.lang.NullPointerException
The following appears in the
atlassian-jira.log
:2012-03-06 12:56:17,948 http-8081-7 ERROR admin 776x191136x1 1p91xei 192.168.199.185 /secure/EditIssue.jspa [web.action.issue.EditIssue] Exception occurred editing issue: java.lang.NullPointerException java.lang.NullPointerException at com.atlassian.jira.issue.customfields.impl.MultiSelectCFType.getChangelogString(MultiSelectCFType.java:259) at com.atlassian.jira.issue.fields.CustomFieldImpl.getChangelogString(CustomFieldImpl.java:357) at com.atlassian.jira.issue.fields.CustomFieldImpl.updateValue(CustomFieldImpl.java:413) at com.atlassian.jira.issue.fields.CustomFieldImpl.updateValue(CustomFieldImpl.java:362) at com.atlassian.jira.issue.managers.DefaultIssueManager.updateFieldValues(DefaultIssueManager.java:633)
- Trying to move issue from one issue type to another or changing the issue type scheme for a project causing the same stack trace in
atlassian-jira.log
Diagnosis
- JIRA was at one point upgraded to JIRA 4.4+ from an older version.
- You can run the following SQL query to verify if there are any Multi-Select Type field which still have the
stringvalue
to be other than ID
select * from customfieldvalue where customfield in (select id from customfield where customfieldtypekey like '%multiselect%') order by stringvalue desc;
Cause
As of JIRA 4.4, the way JIRA stores Select and Multi-Select Type fields was changed, as in our Plugin Developer Notes for JIRA 4.4 documentation which quoted:
We now store the ID (as opposed to the literal value) of the custom field option in the customfieldvalue table.
As a result, a conversion process was implemented during an upgrade from old data. In cases where the conversion would fail, JIRA would still check the legacy data. When this occurs, there is data in both the new and the old customfield value storage format.
Workaround
Access an affected issue and click Edit > Update. JIRA will show the NPE error, but will also fix the issue. This of course, means that each affected issue must be checked.
Resolution
If the above workaround does not help, then you will need identify the problematic custom field and open a ticket with Atlassian Support. Unfortunately there are isn't a known "fix all" solution yet, but support may be able to help get your instance into a better state.
Related Content
- JRA-25034Getting issue details... STATUS
- JRA-26670Getting issue details... STATUS