How to import multiple values on a new line in an Assets object attribute of type TextArea using JSON

Still need help?

The Atlassian Community is here for you.

Ask the community


Platform Notice: Cloud - This article applies to Atlassian products on the cloud platform.

Summary

This article will explain the json format that needs to be used in order to import multiple values on a new line into an Asset Object attribute of type - TextArea.

Scenario

The admin would like to import multiple values for a single attribute and display these values on a new line. However, the admin would like to perform this import using a json file rather than doing a conventional .csv file import.

For example, if you have an Asset object attribute named 'StreetAddress' and you would like to import multiple addresses for the same object and display them on separate lines. 

Solution

Part 1: Prepare your JSON file 

For example, if you have an object type = Manufacturer and object name = Dell. The object type has an attribute named 'StreetAddress' of type TextArea . Now, you would like to import the following addresses into this attribute and display them on a new line:

  • 20 Short Street
  • 40 Long Street

The JSON file format will be as follows(Add a \n  character for every new line):

{
  "Manufacturer": [
    {
      "Name": "Dell",
      "StreetAddress": "20 Short Street\n40 Long Street"
    }
  ]
}


The file extension will be in the format filename.json

Part 2: Create & Run import

  1. Create an attribute of type value 'TextArea' in the required object type.
  2. On the left hand menu, click on the 'Cog' icon next to Schema configuration 
  3. Click on the Import tab 
  4. Click on Create import 
  5. Select the import type as JSON Import as shown in the screenshot below and then click Next:
  6. Enter the required name and select the json file file to be imported.
  7. Edit the attributes mapping  as required.
  8. Click on Run import 


Once the import runs successfully, the values in the attribute will be displayed as follows:

For more details on Importing assets into JSM, please refer to the following support documentation:


Last modified on Nov 5, 2024

Was this helpful?

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