Confluence type object type attribute and object values are not imported using object schema import on Jira Service Management Data Center
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
The object schema import on Jira Service Management Data Center fails to import the Confluence type object type attribute and object values from a different Jira instance
Environment
Verified on Jira Service Management Data Center 5.12.x
Diagnosis
This happens if the schema is exported from a different Jira instance.
After a successful schema import via Importing an object schema, all Confluence type object type attributes are missing. The imported objects don't have the expected Confluence pages as the attribute value post-import.
The message below can be found in insight_objectschema_import.log post-import, which shows that the Confluence type attribute is not stored due to an invalid type value.
1
2
3
2024-07-30 14:07:49,286+0200 insight-InsightThreadGroup-worker-thread-6 WARN assets@atlassian.com [c.r.j.p.i.s.i.schema.log.ImportObjectSchemaLogger] Unable to store object type attribute
ObjectTypeAttributeBean [id=null, name=Wiki page, type=CONFLUENCE, defaultType=NONE] for object type ObjectTypeBean [id=123, name=Team] ValidationInsightException: Validation errors were found:
typeValue: ErrorMessage{i18nKey='rlabs.insight.i18n.constraint.violation.ObjectTypeAttributeBean.Invalid.confluenceTypeValue', parameters=[], additionalMessage=null};
Cause
Let's take this object type attribute as an example:
ID: 10663
Name: Linked Confluence Page
In the schema.xml (in the extracted schema export zip file) which is the file that describes the schema structure, this is how the object type attribute is described:
1
2
3
4
5
6
<id>10663</id>
<label>false</label>
<name>Linked Confluence Page</name>
<type>3</type>
<defaultTypeId>-1</defaultTypeId>
<typeValue>fba05a30-81fa-3456-a3f1-61e0a41bc701</typeValue>
We have
the object type attribute ID.
whether the attribute is a label or not.
the object type attribute name.
the object type attribute type in the form of a number. 3 is the ID of a Confluence type object type attribute.
defaultTypeId
is the "Additional Value" in the UI. In this example, we have -1 which means "All Spaces".typeValue
is the "Type value" in the UI. In the UI, we see the name of the application, which is "Confluence" in this example. The application link ID, "fba05a30-81fa-3456-a3f1-61e0a41bc701" is used in the XML file.
The application link ID is unique across Jira instances. Even if both the Jira instance where the schema is exported and the Jira instance where the schema will be imported are linked to the same Confluence instance, the application link ID will be different. During the import, if the application link ID in the schema.xml is not found and matches with the existing application link with Confluence, the attribute will not imported.
Solution
This solution only solves the issue with missing Confluence type attributes post-object schema import. If the Confluence instance is also migrated, another procedure is required to ensure that the objects are imported with valid associations with the Confluence pages. Please refer to How to update the Confluence attribute type values of Assets objects on Jira Service Management Data Center post Confluence Data Center migration for the solution.
The first part of the solution is to identify the application link ID for the replacement. There are 2 ways to do this.
Retrieve application link ID via UI
On the target Jira instance (where the schema should be imported), go to Administration > Applications > Application links.
Edit the desired application link by clicking on the pencil icon.
The application link ID can be copied from the last part of the page URL. Here's an example of the URL,
fba05a30-81fa-3456-a3f1-61e0a41bc701
, is the application link ID.1
https://atlassian.com/jira/plugins/servlet/applinks/edit/fba05a30-81fa-3456-a3f1-61e0a41bc701
Retrieve application link ID via database
On the database connected to the target Jira instance (where the schema should be imported), execute the SQL query below.
For PostgreSQL
1
SELECT SUBSTR(a.property_key,16,36) as "Application Key", b.propertyvalue as "Application Name" FROM propertyentry a join propertystring b on a.id=b.id where a.property_key like 'applinks.admin%name';
Copy the full Application Key value of the desired Confluence application. Here's an example result of the SQL query above.
1 2 3
Application Key |Application Name| ------------------------------------+----------------+ fba05a30-81fa-3456-a3f1-61e0a41bc701|Confluence |
The second part is to update the schema export file. With the application link ID for replacement, follow the steps below.
Unzip the schema export.
Extract the exported zip file.
Open theschema.xml, which is located in the extracted export file.
Search for a line that contains the string below in the schema.xml.
1
<type>3</type>
Locate the line
typevalue
within the same block.1 2 3 4 5 6
<id>10663</id> <label>false</label> <name>Linked Confluence Page</name> <type>3</type> <defaultTypeId>-1</defaultTypeId> <typeValue>fba05a30-81fa-3456-a3f1-61e0a41bc701</typeValue>
Replace the application link accordingly.
Verify if there are other Confluence type object type attributes in the same schema.xml that need to have the application link ID replaced as well.
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 all object type attributes are imported as expected.
Was this helpful?