JSON import
This import type will import objects into Assets with a JSON file. More about importing
You need to be an Assets Manager for an object schema to create, configure, and enable imports.
Skip to:
- Before you begin
- Importing JSON files
- Pre-defined structure and configuration
- Import configuration created
- Object type and attribute mapping settings
- Known limitations
Before you begin
Here are some additional details that you might need to know to import a JSON file:
JSON files that are imported into Assets must follow JSON standards.
The size limit for the JSON file is 10 MB.
Additionally, you can create an object type mapping with or without a selector, but it depends on how the JSON file is structured. If you use the selector, it must be in the format [Attribute.*[Attribute]
.
Importing JSON files
For testing purposes, you can use the following JSON file sample. By using this file, you can create three Object Types with their mappings and have object references.This file includes the information about cakes, such as batter or topping.
{
"id": "0001",
"type": "donut",
"name": "Cake",
"ppu": 0.55,
"batters":
{
"batter":
[
{ "id": "1001", "type": "Regular" },
{ "id": "1002", "type": "Chocolate" },
{ "id": "1003", "type": "Blueberry" },
{ "id": "1004", "type": "Devil's Food" }
]
},
"topping":
[
{ "id": "5001", "type": "None" },
{ "id": "5002", "type": "Glazed" },
{ "id": "5005", "type": "Sugar" },
{ "id": "5007", "type": "Powdered Sugar" },
{ "id": "5006", "type": "Chocolate with Sprinkles" },
{ "id": "5003", "type": "Chocolate" },
{ "id": "5004", "type": "Maple" }
]
}
If you select the “Name” attribute as Label, you’ll create four objects: “Blueberry”, “Chocolate”, “Devil’s Food”, and “Mail Server”. This will result in a configuration like this:
From your service project, go to Assets, then Object Schemas.
From the Object Schemas list, select More actions and then select Configure.
In the Schema configuration view, open the Import tab.
Under the Import tab:
If there’s no import structure, you’ll see the message “You don't have any import connections yet”. Select Create Import configuration to create a new import structure.
If an import structure has already been created, select Create Configuration.
Select CSV import, then select Next.
Fill in the General, Module, and Scheduling import fields.
7. Select Save Import Configuration.
Next, you can create a predefined structure and configuration for your JSON file.
Pre-defined structure and configuration
Create predefined structure – this will create object types with attributes and relationships in the schema
Create predefined configuration – this will create type mappings in the import configuration.
For the JSON import, the predefined structure and configuration will be created based on the JSON file or URL present in the configuration. Some object type mappings might be disabled by default. Ensure that all object type mappings are enabled.
Import configuration created
You can now view your import configuration, but it's not ready yet. You still need to create or review the object type and attribute mapping, and make sure there are no problems with your import configuration.
When you're ready, go to 2. Create object type and attribute mapping.
Before you go
In the next step, you'll create the object type and attribute mapping. Here are some settings specific to the JSON import type.
Object type mapping settings
Name | Description |
---|---|
Selector | The selector for the JSON import. Use Exemple:
Only JSON arrays are valid as selector. |
Attribute mapping settings
Name | Description |
---|---|
attribute1[*].attribite2[*].. | The data locators provided are depending on the JSON and the selector configured. |
Known limitations
Currently, the JSON import doesn’t support the use of OAuth tokens or API tokens for authentication when importing the JSON file using a URL. Only basic authentication is supported. As a workaround, you can save the JSON file on Jira's host and import the file again. This method can be used to bypass authentication issues, but it doesn’t support automatic, scheduled imports directly from external sources.
To automate schedule imports directly from external sources, you can save new JSON output with the same filename and archive older versions with a date and timestamp. This allows the use of scheduled file upload imports, but requires careful file management to ensure the correct file is imported each time.