JSON インポート
This import type will import objects into Assets with a JSON file. More about importing
インポートを作成、設定、有効化するには、ユーザーがオブジェクト スキーマのアセット マネージャーである必要があります。
次のセクションにジャンプ:
はじめる前に
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.
事前定義済みの構造と設定
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.
作成されたインポート設定
これでインポート設定を表示できるようになりましたが、まだ準備が完了していません。引き続き、オブジェクト タイプと属性のマッピングを作成または確認して、インポート設定に問題がないことを確実にする必要があります。
準備できたら「2. オブジェクト タイプと属性マッピングを作成する」に進みます。
最後に一言
次のステップでは、オブジェクト タイプと属性マッピングを作成します。JSON インポート タイプに固有の設定をいくつか紹介します。
オブジェクト タイプ マッピングの設定
名前 | 説明 |
---|---|
セレクター | JSON インポートのセレクター。
例:
JSON 配列のみがセレクターとして有効です。 |
属性マッピングの設定
名前 | 説明 |
---|---|
attribute1[*].attribite2[*].. | 指定されるデータ ロケーターは、JSON と設定されているセレクターによって異なります。 |
既知の制限事項
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.