How to import Assets object types with attributes referencing existing objects
Platform Notice: Cloud and Data Center - This article applies equally to both cloud and data center platforms.
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
Learn how to import an Assets object type from one schema to another schema, maintaining the object reference for object attributes that reference an existing Assets object.
Solution
When importing an object type whose attributes reference other objects, you must import the referenced object type first; otherwise, the references can't resolve on the destination.
In the source schema, open the reference object type > Bulk action (settings cog) > Export Objects, then download the CSV.
On the destination schema, Action(...) → Configure → Import tab, create a new CSV Import configuration and map the reference attribute to the imported reference object type.
On the Import tab, create a new import configuration. Select CSV Import.
Name the import configuration. To import it, select the CSV import file generated in step 2, then save the import configuration.
For each type of object that you want to map in Assets, you must create an object type, and for each attribute or reference that you want to map in Assets, you must create an attribute. Once you save the import configuration in step 6, you can either select an existing object type to import into, or create a predefined object type and configuration to automatically create the object type structure based on the CSV file.
If needed, change the object type's attribute type to match the type set in the source schema.
Click on the newly created Import configuration to expand it and Create Object Type Mapping.
For each attribute you want to add to the object type:
Select a Data Locator. The data locator specifies the location of the data in the import configuration.
Select an Assets object Attribute to map with the Data Locator.
Click Add, at right.
Once all attributes to be imported are mapped, execute the import.
After the import completes and the destination schema is populated with the object type, it's time to import the object type that contains attributes referencing the previously imported object type. Repeat steps 1 to 9 for the 'child' object type.
For the step to export the object type to a CSV file, make sure to select User friendly as the format for the CSV file. Otherwise, the data exported for the object attribute will be in the object key format instead of the attribute label, which will cause the object type attribute mapping NOT to work! This is due to the object key not being maintained and each import process will generate a new key for each object that is imported to the schema – the object label is required for the object type attribute mapping.
When mapping an attribute from the CSV file to an object type, if the attribute references an object in the reference object type, you will need to use the placeholder in the import configuration (under Object mapping) to import the data correctly. Use the Object Mapping (AQL) column to enter AQL that maps the reference's label to a placeholder for the data locator.
If you are mapping only one reference from the data, enter
Label = ${Locator}whereLocatoris replaced by the Locator's name.Note: this example will use the attribute set as the label. By default, the "Name" attribute is set as a label, and this can be changed in the Attributes screen for the referenced object type. In a situation where "Name" is set as a label, the alternative, corresponding AQL that can be used is:
Name = ${ObjectA}If you are mapping multiple references from the data, enter
Label IN (${Locator${0}})whereLocatorsis replaced by the Locators' names.
Execute the import for the object type.
After importing the dependent object type, open a sample object and confirm that its reference attribute points to the correct destination object; if the references are blank, confirm that the reference object type was imported first.
Was this helpful?