Unable to Create Issue due to corrupt Custom Field

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

When trying to create an issue, the following is displayed:

Oops - an error has occurred

System Error

A system error has occurred.

Please try submitting this problem via the Support Request Page

Otherwise, please create a support issue on our support system at http://support.atlassian.com with the following information:

  1. a description of your problem

  2. cut & paste the error and system information found below

  3. attach the application server log file ( C:\Atlassian\ApplicationData\home\log\atlassian-jira.log )

Cause:

java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Long

Stack Trace

1 2 3 4 java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Long at com.atlassian.jira.issue.customfields.impl.SelectCFType.getDefaultValue(SelectCFType.java:243) at com.atlassian.jira.issue.customfields.impl.SelectCFType.getDefaultValue(SelectCFType.java:68) at com.atlassian.jira.issue.fields.CustomFieldImpl.populateDefaults(CustomFieldImpl.java:561)

And when trying to edit the custom field options, the following System Error appears:

Cause:

com.atlassian.jira.exception.DataAccessException: No custom field for issuetype. This should not happen. Data is likely to be corrupt.

Stack Trace

1 2 3 com.atlassian.jira.exception.DataAccessException: No custom field for issuetype. This should not happen. Data is likely to be corrupt. at com.atlassian.jira.issue.fields.config.FieldConfigImpl.getCustomField(FieldConfigImpl.java:65) at com.atlassian.jira.web.action.admin.customfields.AbstractEditConfigurationItemAction.getCustomField(AbstractEditConfigurationItemAction.java:37)

Similar symptoms can be seen on the Service Management portal where a form to create an issue will not be displayed when the customer clicks on it.

Cause

The Field Configuration of the custom field is mistakenly pointing to the Field Configuration of the Issue Type instead of it's own. What causes this is yet unknown. However it might be possible the issue was caused by this JRASERVER-75919 - Jira custom field context broken after upgrade to 9.7.0+ BUG.

Resolution

Remember to backup your database before making any changes

  1. Get the ID of the problematic Custom Field:

    1 SELECT * FROM customfield WHERE cfname = 'Name';

    ℹ️ Replace 'Name' with the actual name of the custom field.

  2. Identify what is the correct id of the Custom Field's Field Configuration:

    1 SELECT * FROM fieldconfiguration WHERE fieldid = 'customfield_XXXXX';

    ℹ️ Replace 'XXXXX' with the ID of the custom field returned in the first step.

  3. Identify what is the correct id of the Custom Field's Field Configuration Scheme:

    1 SELECT * FROM fieldconfigscheme WHERE fieldid = 'customfield_XXXXX';

    ℹ️ Replace 'XXXXX' with the ID of the custom field returned in the first step.

  4. Ensure there is only one row returned with the following query:

    1 SELECT * FROM fieldconfigschemeissuetype WHERE fieldconfigscheme = <id>;

    ℹ️ This is the id returned on step #3 (Field Configuration Scheme id).

  5. Update the database so that the Custom Field will point to the right Field Configuration:

    1 UPDATE fieldconfigschemeissuetype SET fieldconfiguration = <FIELD_CONFIG_ID> WHERE fieldconfigscheme = <FIELD-CONFIG-SCHEME-ID>;

    ℹ️ Replace the <FIELD_CONFIG_ID> with the ID returned on step #2 and <FIELD-CONFIG-SCHEME-ID> with the one returned on step #3.

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.