JSON からのデータのインポート
インポート用 JSON ファイルの作成
If your current issue tracking system is unable to export in the JSON format, you may wish to create the file manually. To prepare the JSON file, you should use the standard JSON format and follow the pattern detailed below. The field values in the following example are set with illustrative purpose only. Use data from your instance to prepare the JSON file.
If you want to create sub-tasks for custom sub-task links, use exactly the same name
as provided in the following example: "name": "sub-task-link"
.
{
"users": [
{
"name": "alice",
"fullname": "Alice Foo"
},
{
"name": "bob",
"fullname": "Bob Bar"
}
],
"links": [
{
"name": "sub-task-link",
"sourceId": "2",
"destinationId": "1"
},
{
"name": "Duplicate",
"sourceId": "3",
"destinationId": "2"
}
],
"projects": [
{
"name": "A Sample Project",
"key": "ASM",
"type": "software",
"description": "JSON file description",
"versions": [
{
"name": "1.0",
"released": true,
"releaseDate": "2012-08-31T15:59:02.161+0100"
},
{
"name": "2.0"
}
],
"components": [
"Component",
"AnotherComponent"
],
"issues": [
{
"priority" : "Major",
"description" : "Some nice description here\nMaybe _italics_ or *bold*?",
"status" : "Closed",
"reporter" : "alice",
"labels" : [ "impossible", "to", "test" ],
"watchers" : [ "bob" ],
"issueType" : "Bug",
"resolution" : "Resolved",
"created" : "2012-08-31T17:59:02.161+0100",
"updated" : "P-1D",
"affectedVersions" : [ "1.0" ],
"summary" : "My chore for today",
"assignee" : "bob",
"fixedVersions" : [ "1.0", "2.0" ],
"components" : ["Component", "AnotherComponent"],
"externalId" : "1",
"history" : [
{
"author" : "alice",
"created": "2012-08-31T15:59:02.161+0100",
"items": [
{
"fieldType" : "jira",
"field" : "status",
"from" : "1",
"fromString" : "Open",
"to" : "5",
"toString" : "Resolved"
}
]
}
],
"customFieldValues": [
{
"fieldName": "Story Points",
"fieldType": "com.atlassian.jira.plugin.system.customfieldtypes:float",
"value": "15"
},
{
"fieldName": "Business Value",
"fieldType": "com.atlassian.jira.plugin.system.customfieldtypes:float",
"value": "34"
}
],
"attachments" : [
{
"name" : "battarang.jpg",
"attacher" : "admin",
"created" : "2012-08-31T17:59:02.161+0100",
"uri" : "http://optimus-prime/~batman/images/battarang.jpg",
"description" : "This is optimus prime"
}
]
},
{
"status" : "Open",
"reporter" : "bob",
"issueType": "Sub-task",
"created" : "P-3D",
"updated" : "P-1D",
"summary" : "Sub-task",
"externalId": "2"
},
{
"status" : "Closed",
"reporter" : "alice",
"issueType": "Sub-task",
"created" : "P-3D",
"updated" : "P-1D",
"resolution" : "Duplicate",
"summary" : "Duplicate Sub-task",
"externalId": "3"
}
]
}
]
}
カスタム フィールド
JSON Importers プラグインではカスタムフィールドがサポートされています。次に、JIRA で用意されているカスタムフィールドの一覧を示します。 カスタムフィールドのがある追加のプラグインをインストールしている場合はそれらのフィールドもサポートされますが、この一覧には含まれていません。
次のカスタムフィールドの例では、カスタムフィールドを追加するための構文を示しています。カスケード型カスタムフィールドの例も含まれます。前の一覧にカスタムフィールドがない場合は、「カスタムフィールドの設定」ページでソース HTML を調べて "fieldType" を取得できます。"value" は各カスタムフィールドに固有です。これは、「課題の編集」ページでソース HTML を調べることで確認できます。
"customFieldValues": [
//Custom Fields which accepts single values:
{
"fieldName": "My Awesome Text Field (single line)",
"fieldType": "com.atlassian.jira.plugin.system.customfieldtypes:textfield",
"value": "some text"
},
{
"fieldName": "My Awesome Select List (single choice)",
"fieldType": "com.atlassian.jira.plugin.system.customfieldtypes:select",
"value": "some select"
},
//Custom Fields which accepts multiple values:
{
"fieldName": "My Awesome Checkboxes",
"fieldType": "com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes",
"value": [ "multiple", "checkboxes" ]
},
{
"fieldName": "My Awesome User Picker (multiple users)",
"fieldType": "com.atlassian.jira.plugin.system.customfieldtypes:multiuserpicker",
"value": [ "admin", "fred" ]
},
//Custom Fields which accepts Options in hierarchy. That's only cascading select from standard JIRA pool.
{
"fieldName": "My Awesome Select List (cascading)",
"fieldType": "com.atlassian.jira.plugin.system.customfieldtypes:cascadingselect",
"value":
{
"": "Parent Value",
"1": "Child Value"
}
}
]
JSON ファイルの具体例
次に、JSON ファイルの具体例を示します。
サポートされているフィールド | 注意 | 例 |
---|---|---|
ユーザー | この例ではフルユーザーに対応し、、2つのグループが指定されています。グループが存在しない場合、Jira Importers プラグインによって作成されます。 |
ユーザーの例
|
バージョン | 問題をインポートして fixVersion などを指定するには、この fixVersion を JSON ファイルで定義する必要があります。バージョンが Jira にすでに存在する場合も、 JSON で指定する必要があります。 |
バージョン
|
プロジェクトキーと課題キー | プロジェクトと課題の両方にキーを割り当てることができます。これらのキーは異なっていてかまいません。この例では、1つの課題があるプロジェクト "SAM-123" が作成されます。 |
プロジェクト キーと課題キーの例
|
コメント | この例では、課題について複数のコメントをインポートする方法を示しています。 |
コメントの例
|
作業ログ | この例では、作業ログの詳細をインポートするための構文を示しています。 |
作業ログの例
|
コンポーネント | JSON ファイルでは 2 つの方法でコンポーネントを指定できます。これは、名前を指定する方法と、オブジェクトを指定する方法です。この例では両方を示しています。Jira Importers プラグインでは、常に "既定の担当者" が "プロジェクトの既定" に設定された新規コンポーネントが作成されます。これは、ユーザーは既定の担当者を指定できないためです。 |
コンポーネントの例
|
タイムトラッキング付きの課題 | 課題とともに、タイムトラッキングの詳細をインポートできます。この例では、タイムトラッキングの詳細を含む課題を示しています。 "originalEstimate"、"timeSpent"、"estimate" の値は Period 形式 (Format ISO_8601 - Durations) に従っている必要があります。"startDate" の値には DateTime と Period 形式の両方を使用できます。 インポートを開始する前に、Jira でタイム トラッキングが有効になっていることを確認してください。有効になっていない場合、Jira Importers プラグインでのインポート中にデータが無視されます。 |
タイムトラッキング付きの課題
|
日付の表現には、SimpleDateFormat "yyyy-MM-dd'T'HH:mm:ss.SSSZ"
(出力例: "2012-08-31T15:59:02.161+0100"
)、または "P-1D" (1日前) などの相対日付を使用できます。
JSON File Import Wizard の実行
開始する前に、Jira データをバックアップします。
- Jira 管理者グローバル権限を持つユーザーとしてログインします。
- Choose Administration ( ) > System. Select Import & Export > External System Import to open the Import external projects page.
- JSON を選択してJSON ファイル インポートページを開きます。
- Upload your JSON file.
- JSON ファイルを Jira にインポートする準備ができたら、[インポート開始] ボタンをクリックします。インポーターは、インポートの進行に合わせて更新状況を示し、インポートが完了すると、正常完了したことを示すメッセージを表示します。
注: インポートで問題が生じた場合 (または関心がある場合)、詳細ログのダウンロードリンクをクリックして、JSON ファイルのインポートプロセスに関する詳細情報を表示します。この情報は、インポートでエラーが発生した場合も役立ちます。
これで、JSON プロジェクトを Jira に正常にインポートできました。ご不明な点や、問題が生じた場合は、アトラシアン サポートにご連絡ください。