Mail Handler Fails due to Custom Field NOT Configured for Any Context
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
Summary
Symptoms
Mail Handler fails to create issues or add comments. One or more of the following NullPointerException appears in the atlassian-jira-incoming-mail.log
file:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
2014-08-25 11:50:53,067 WARN [jira@jiraserver] atlassian-scheduler-quartz1.clustered_Worker-4 ServiceRunner Systems Issue Email Handler Systems Issue Email Handler[10010]: Unable to create issue with message.
java.lang.NullPointerException
at com.atlassian.jira.issue.customfields.impl.MultiSelectCFType.getDefaultValue(MultiSelectCFType.java:205)
at com.atlassian.jira.issue.customfields.impl.MultiSelectCFType.getDefaultValue(MultiSelectCFType.java:83)
at com.atlassian.jira.issue.fields.CustomFieldImpl.getDefaultValue(CustomFieldImpl.java:1248)
...
2014-08-26 00:41:32,362 WARN [jira@jiraserver] atlassian-scheduler-quartz1.clustered_Worker-3 ServiceRunner Systems Issue Email Handler Systems Issue Email Handler[10010]: Unable to create issue with message.
java.lang.NullPointerException
at com.atlassian.jira.issue.customfields.impl.SelectCFType.getDefaultValue(SelectCFType.java:244)
at com.atlassian.jira.issue.customfields.impl.SelectCFType.getDefaultValue(SelectCFType.java:69)
at com.atlassian.jira.issue.fields.CustomFieldImpl.getDefaultValue(CustomFieldImpl.java:1248)
...
2014-09-05 15:04:27,246 atlassian-scheduler-quartz1.clustered_Worker-2 WARN ServiceRunner Create Helpdesk Issue [atlassian.mail.incoming.mailfetcherservice] Create Helpdesk Issue[10030]: Unable to create issue with message.
java.lang.NullPointerException
at com.atlassian.jira.issue.customfields.impl.AbstractMultiCFType.getDefaultValue(AbstractMultiCFType.java:88)
at com.atlassian.jira.issue.customfields.impl.AbstractMultiCFType.getDefaultValue(AbstractMultiCFType.java:39)
at com.atlassian.jira.issue.fields.CustomFieldImpl.getDefaultValue(CustomFieldImpl.java:1248)
...
2014-09-20 12:43:42,879 WARN [jira] atlassian-scheduler-quartz1.clustered_Worker-3 ServiceRunner Create issues via email Create issues via email[10101]: Unable to create issue with message.
java.lang.NullPointerException
at com.atlassian.jira.issue.customfields.impl.LabelsCFType.getDefaultValue(LabelsCFType.java:147)
at com.atlassian.jira.issue.customfields.impl.LabelsCFType.getDefaultValue(LabelsCFType.java:73)
at com.atlassian.jira.issue.fields.CustomFieldImpl.getDefaultValue(CustomFieldImpl.java:1248)
Diagnosis
Using JIRA older than 6.3.5
One or more custom fields have at least ONE scheme not configured for any contexts
If the custom field has only one scheme, it can be easily noticed from Custom Fields page:
If the custom field has more than one scheme and at least one of them is configured for a context, then this context will be shown on Custom Fields page, which makes it harder to find in case there're lots of custom fields. JIRA Admin will have to manually Configure every custom field to find this out (refer to Workaround for a better way):
Cause
This is caused by a Bug as reported in JRASERVER-39687 - Unable to create issues using mail handler when custom fields are not configured for any context.
Solution
Workaround
Run this SQL query to find all the custom fields which have at least ONE scheme not configured for any contexts:
1
select * from fieldconfigscheme where id not in (select fieldconfigscheme from configurationcontext) and fieldid like 'customfield_%';
The custom field IDs can be seen under FIELDID column, e.g. customfield_11500, customfield_12000
Run this SQL query to find the custom field names (using the above IDs):
1
select id, cfname from customfield where id in (11500, 12000);
Go to Custom Fields page, Configure each of the above custom fields and delete the problematic schemes or modify them to use proper contexts
Resolution
Upgrade JIRA to 6.3.5 or above, where the Bug is Fixed.
Was this helpful?