Unable to Create Issue due to corrupt Custom Field

Still need help?

The Atlassian Community is here for you.

Ask the community

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
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
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 - Getting issue details... STATUS BUG.

Resolution

Remember to backup your database before making any changes

  1. Get the ID of the problematic Custom Field:

    SELECT * FROM customfield WHERE cfname = 'Name';

    (info) Replace 'Name' with the actual name of the custom field.

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

    SELECT * FROM fieldconfiguration WHERE fieldid = 'customfield_XXXXX';
    

    (info) 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:

    SELECT * FROM fieldconfigscheme WHERE fieldid = 'customfield_XXXXX';
    

    (info) 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:

    SELECT * FROM fieldconfigschemeissuetype WHERE fieldconfigscheme = <id>;

    (info) 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:

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

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


Last modified on Mar 21, 2024

Was this helpful?

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