Importing project data fails with Unexpected import failure due to CustomFieldValue with no value
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
Importing a project with Project Configurator results in error, with this stack in the logs:
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
27
28
2022-01-12 11:18:54,794 JiraTaskExecutionThread-79 ERROR jira 123x123x1 abc2ab 192.168.1.100 /secure/complete-project-import!resumeImportFromSimulation.jspa [c.a.j.imports.xml.DefaultBackupXmlParser] Unexpected import failure
java.lang.NullPointerException
at com.atlassian.jira.imports.project.customfield.TextLengthValidatingCustomFieldImporter.canMapImportValue(TextLengthValidatingCustomFieldImporter.java:24)
at com.atlassian.jira.imports.project.handler.CustomFieldValueValidatorHandler.validateCustomFieldValueWithField(CustomFieldValueValidatorHandler.java:98)
at com.atlassian.jira.imports.project.handler.CustomFieldValueValidatorHandler.handleEntity(CustomFieldValueValidatorHandler.java:73)
at com.atlassian.jira.imports.project.handler.ChainedOfBizSaxHandler.endTopLevelElement(ChainedOfBizSaxHandler.java:221)
at com.atlassian.jira.imports.project.handler.ChainedOfBizSaxHandler.endElement(ChainedOfBizSaxHandler.java:169)
at com.atlassian.jira.imports.project.handler.ChainedOfBizSaxHandler.endElement(ChainedOfBizSaxHandler.java:136)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at com.atlassian.security.xml.RestrictedXMLReader.parse(RestrictedXMLReader.java:103)
at com.atlassian.jira.imports.xml.DefaultBackupXmlParser$XmlParser.parseXml(DefaultBackupXmlParser.java:115)
at com.atlassian.jira.imports.xml.DefaultBackupXmlParser.parse(DefaultBackupXmlParser.java:64)
at com.atlassian.jira.imports.xml.DefaultBackupXmlParser.parseXml(DefaultBackupXmlParser.java:52)
at com.atlassian.jira.imports.xml.DefaultBackupXmlParser.parseOfBizBackupXml(DefaultBackupXmlParser.java:41)
at com.atlassian.jira.imports.project.DefaultProjectImportManager.validateCustomFieldValues(DefaultProjectImportManager.java:756)
at com.atlassian.jira.bc.imports.project.DefaultProjectImportService.validateAndAutoMapFields(DefaultProjectImportService.java:634)
at com.atlassian.jira.bc.imports.project.DefaultProjectImportService.doMapping(DefaultProjectImportService.java:322)
at com.awnaba.projectconfigurator.transporter.engine.JiraDataImporter.jiraImportData(JiraDataImporter.java:295)
...
Cause
This is caused when the entities.xml
contains a CustomfieldValue
entry for a text custom field with no value.
For example:
1
<CustomFieldValue id="20140" issue="15275" customfield="10706"/>
Solution
To solve this issue:
Unzip the project dump zip;
Unzip the data.zip file;
Open the entities.xml file;
Remove the line with the incomplete
CustomFieldValue
entry, as the example above;Zip the activeobjects.xml and entities.xml together into the data.zip again;
ℹ️ Be careful to zip just the files! If you zip the directory above it, the file structure might be changed, and a different error will happen on import;
Zip the original directories (data and attachments) with the coinfig.xml file;
Import the project.
Was this helpful?