Some object type attributes are not imported despite a successful Assets object schema import on Jira Service Management Data Center
Platform Notice: Data Center - This article applies to Atlassian products on the Data Center platform.
Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles 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
Some object type attributes are not imported despite a successful Assets object schema import from the zip file
Environment
Verified on Jira Service Management Data Center 5.12.7
Diagnosis
- This usually affects only one or a few object types instead of all object types. Having said that, most object types have all attributes successfully imported.
- Depending on the position of the attribute that is causing this issue to happen, the affected object types do have other attributes with positions before the problematic attribute that are imported successfully.
The message below can be found in the insight_objectschema_import.log. It states that the object type attributes for the Host object type with ID 123 are skipped due to an empty value.
2024-07-24 15:25:15,940 [http-nio-0.0.0.0-8080-exec-13] | Unable to insert object type attributes for ObjectTypeBean [id=123, name=Hosts] will skip this object type java.lang.NumberFormatException: For input string: "" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) ~[?:?] at java.lang.Integer.parseInt(Integer.java:662) ~[?:?] at java.lang.Integer.<init>(Integer.java:1105) ~[?:?] at com.riadalabs.jira.plugins.insight.services.imports.schema.ObjectSchemaImportServiceImpl.handleObjectTypeAttributesInImport(ObjectSchemaImportServiceImpl.java:740) ~[insight-10.12.1-QR-0126.jar:?] at com.riadalabs.jira.plugins.insight.services.imports.schema.ObjectSchemaImportServiceImpl.handleObjectTypeAttributesInImport(ObjectSchemaImportServiceImpl.java:831) ~[insight-10.12.1-QR-0126.jar:?] at com.riadalabs.jira.plugins.insight.services.imports.schema.ObjectSchemaImportServiceImpl.createOrAppendToObjectSchema(ObjectSchemaImportServiceImpl.java:570) ~[insight-10.12.1-QR-0126.jar:?] at com.riadalabs.jira.plugins.insight.services.imports.schema.ObjectSchemaImportServiceImpl.importObjectSchemaDefinition(ObjectSchemaImportServiceImpl.java:1041) ~[insight-10.12.1-QR-0126.jar:?] at com.riadalabs.jira.plugins.insight.services.imports.schema.ObjectSchemaImportServiceImpl.importObjectSchemaNoObjects(ObjectSchemaImportServiceImpl.java:359) ~[insight-10.12.1-QR-0126.jar:?] at com.riadalabs.jira.plugins.insight.services.imports.schema.ObjectSchemaImportServiceImpl.importObjectSchemaDefinition(ObjectSchemaImportServiceImpl.java:299) ~[insight-10.12.1-QR-0126.jar:?] at com.riadalabs.jira.plugins.insight.channel.web.api.rest.services.ObjectSchemaImportResource.importObjectSchemaFromServer(ObjectSchemaImportResource.java:92) ~[insight-10.12.1-QR-0126.jar:?] ...
Cause
The affected object type has a Status type attribute with an empty type value in the exported zip file. The root cause of this empty type value is unknown at the moment.
Solution
One solution is to remove the empty value tag from the zip file and perform the import again.
- Extract the exported zip file.
- Open the schema.xml, which is located in the extracted export file.
Search for a line that contains the string below in the schema.xml.
<typeValue></typeValue>
Verify if this line belongs to the affected object type which does not have all attributes imported. We can find the attribute name and ID within a few lines before the line of
<typeValue></typeValue>
. For example,<objectTypeAttribute> <id>1514</id> <label>false</label> <name>Status</name> <type>7</type> <description>Server status</description> <defaultTypeId>-1</defaultTypeId> <typeValue></typeValue>
Remove the line of
<typeValue></typeValue>
.- Verify if there's more occurrence of empty type value by searching again for
<typeValue></typeValue>
. Remove them if they are for the Status type attribute. - Save the updated schema.xml.
- Compress the updated schema.xml along with other files that were extracted in step 1.
- Attempt the import to create another schema.
- Verify if the schema is imported successfully, including the previously missing attributes.