JSON からのデータのインポート

JSON インポート機能を使用すると、CSV ファイルにエクスポートできない外部課題トラッカーの課題をインポートできます。Jira Importers プラグインでは、Jira REST API を使用する場合のインポート形式よりもシンプルなものを利用します。

インポート用 JSON ファイルの作成

現在の課題トラッキング システムで JSON 形式にエクスポートできない場合は、ファイルを手動で作成することをお勧めします。JSON ファイルを準備するには、標準の JSON 形式を使用して、以下のパターンに従ってください。

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 // JSON File Example { "users": [ { "name": "abcde-12345-fedcba" }, { "name": "edcba-12345-abcdef" } ], "links": [ { "name": "sub-task-link", "sourceId": "2", "destinationId": "1" }, { "name": "Duplicate", "sourceId": "3", "destinationId": "2" } ], "projects": [ { "name": "A Sample Project", "key": "ASM", "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": "abcde-12345-fedcba", "labels": [ "impossible", "to", "test" ], "watchers": [ "abcde-12345-fedcba" ], "issueType": "Bug", "resolution": "Resolved", "created": "2012-08-31T17:59:02.161+0100", "updated": "2012-08-31T17:59:02.161+0100", "affectedVersions": [ "1.0" ], "summary": "My chore for today", "assignee": "abcde-12345-fedcba", "fixedVersions": [ "1.0", "2.0" ], "components": [ "Component", "AnotherComponent" ], "externalId": "1", "history": [ { "author": "abcde-12345-fedcba", "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": "bob@example.com", "created": "2012-08-31T17:59:02.161+0100", "uri": "http://optimus-prime/~batman/images/battarang.jpg", "description": "This is optimus prime" } ] }, { "status": "Open", "reporter": "abcde-12345-fedcba", "issueType": "Sub-task", "created": "P-3D", "updated": "P-1D", "summary": "Sub-task", "externalId": "2" }, { "status": "Closed", "reporter": "abcde-12345-fedcba", "issueType": "Sub-task", "created": "P-3D", "updated": "P-1D", "resolution": "Duplicate", "summary": "Duplicate Sub-task", "externalId": "3" } ] } ] }

インポートされた課題の修正バージョンを指定するには、上記の例のように、fixVersionsissues オブジェクトにversionsprojects オブジェクトに含めるようにします。

カスタム フィールド

JSON Importers プラグインではカスタムフィールドがサポートされています。次に、JIRA で用意されているカスタムフィールドの一覧を示します。 カスタムフィールドのがある追加のプラグインをインストールしている場合はそれらのフィールドもサポートされますが、この一覧には含まれていません。

  • com.atlassian.jira.plugin.system.customfieldtypes:textfield

  • com.atlassian.jira.plugin.system.customfieldtypes:textarea

  • com.atlassian.jira.plugin.system.customfieldtypes:datepicker

  • com.atlassian.jira.plugin.system.customfieldtypes:datetime

  • com.atlassian.jira.plugin.system.customfieldtypes:float

  • com.atlassian.jira.plugin.system.customfieldtypes:select

  • com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons

  • com.atlassian.jira.plugin.system.customfieldtypes:project

  • com.atlassian.jira.plugin.system.customfieldtypes:multiversion

  • com.atlassian.jira.plugin.system.customfieldtypes:version

  • com.atlassian.jira.plugin.system.customfieldtypes:userpicker

  • com.atlassian.jira.plugin.system.customfieldtypes:url

  • com.atlassian.jira.plugin.system.customfieldtypes:multiselect

  • com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes

  • com.atlassian.jira.plugin.system.customfieldtypes:multiuserpicker

  • com.atlassian.jira.plugin.system.customfieldtypes:multigrouppicker

  • com.atlassian.jira.plugin.system.customfieldtypes:grouppicker

  • com.atlassian.jira.plugin.system.customfieldtypes:cascadingselect

  • com.atlassian.jira.plugin.system.customfieldtypes:readonlyfield

  • com.atlassian.jira.plugin.system.customfieldtypes:labels

  • com.pyxis.greenhopper.jira:gh-sprint

次のカスタムフィールドの例では、カスタムフィールドを追加するための構文を示しています。カスケード型カスタムフィールドの例も含まれます。前の一覧にカスタムフィールドがない場合は、「カスタムフィールドの設定」ページでソース HTML を調べて "fieldType" を取得できます。"value" は各カスタムフィールドに固有です。これは、「課題の編集」ページでソース HTML を調べることで確認できます。

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 Custom field example "customFieldValues": [ //Custom fields which accept 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 accept 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 (cascading select fields): { "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 プラグインによって作成されます。

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 User example "users": [  { "name" : "abcde-12345-fedcba", "groups" : [ "jira-users", "my-custom-group" ], "active" : true, "email" : "user1@example.com", "fullname" : "User 1" } ]

プロジェクト キーと課題キー

プロジェクトと課題の両方にキーを割り当てることができます。これらのキーは異なっていてかまいません。この例では、1 つの課題があるプロジェクト "SAM-123" が作成されます。

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 Project key and issue key example { "projects": [ { "name": "Sample data", "key": "SAM", "issues": [ { "key" : "SAM-123", "status" : "Open", "reporter" : "abcde-12345-fedcba", "summary" : "Parent case", "externalId": "123" } ] } ] }

コメント

この例では、課題について複数のコメントをインポートする方法を示しています。

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 Comment example { "projects": [ { "name": "Sample data", "key": "SAM", "issues": [ { "status" : "Open", "reporter" : "abcde-12345-fedcba", "summary" : "Parent case", "externalId": "1", "comments": [ { "body": "This is a comment from admin 5 days ago", "author": "abcde-12345-fedcba", "created": "2012-08-31T17:59:02.161+0100" }, { "body": "This is a comment from admin 1 day ago", "author": "abcde-12345-fedcba", "created": "2012-08-31T17:59:02.161+0100" } ] } ] } ] }

この例は、Jira Service Management 製品専用の公開コメントの表示設定をインポートする方法を示しています。

1 2 3 4 5 6 7 8 9 10 11 12 "comments": [ { "body": "This public comment", "author": "557057:1a8aeee5-40e9-413a-9f4e-2f074f09644a", "created": "2012-08-31T17:59:02.161+0100", "updated": "2012-08-31T17:59:02.161+0100", "properties":[{"key":"sd.public.comment","value":{"internal":"false"}}] } ]

この例は、Jira Service Management 製品専用の非公開コメントの表示設定をインポートする方法を示しています。

1 2 3 4 5 6 7 8 9 10 11 "comments": [ { "body": "This private comment", "author": "557057:1a8aeee5-40e9-413a-9f4e-2f074f09644a", "created": "2012-08-31T17:59:02.161+0100", "updated": "2012-08-31T17:59:02.161+0100", "properties":[{"key":"sd.public.comment","value":{"internal":"true"}}] } ]

作業ログ

この例では、作業ログの詳細をインポートするための構文を示しています。

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 Worklog example "worklogs": [ { "author": "abcde-12345-fedcba", "comment": "Worklog", "startDate": "2012-08-31T17:59:02.161+0100", "timeSpent": "PT1M" }, { "author": "abcde-12345-fedcba", "startDate": "2012-08-31T17:59:02.161+0100", "timeSpent": "PT3H" } ]

Component

JSON ファイルでコンポーネントを指定する方法は2通りあります。名前を指定する方法とオブジェクトを指定する方法です。この例では両方を示しています。Jira Importers プラグインでは、常に「既定の担当者」が「プロジェクトの既定」に設定された新規コンポーネントが作成されます。ユーザーは「既定の担当者」を指定できないからです。

1 2 3 4 5 6 7 8 9 10 11 12 13 14 Component example "components": [ "Component", //Component specified only by name { // Component specified by object "name": "edcba-12345-abcdef", "lead": "abcde-12345-fedcba", "description": "Some description" } ]

タイムトラッキング付きの課題

課題とともに、タイム トラッキングの詳細をインポートできます。この例では、タイム トラッキングの詳細情報を含む課題を示しています。"originalEstimate"、"timeSpent"、"estimate" の値は Period 形式 (Format ISO_8601 - Durations) にする必要があります。"startDate" の値には DateTime と Period の両形式を使用できます。

インポートを開始する前に、Jira でタイムトラッキングが有効になっていることを確認してください。有効になっていない場合、インポート中に Jira Importers プラグインでデータが無視されます。

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 Issues with time tracking "issues": [ { "summary" : "My Example Time Tracking issue", "externalId": "1", "originalEstimate": "P1W3D", "timeSpent": "PT4H", "estimate": "P2D", "worklogs": [ { "author": "abcde-12345-fedcba", "comment": "Worklog", "startDate": "P-1D", //can be a Period or DateTime "timeSpent": "PT1M" }, { "author": "abcde-12345-fedcba", "startDate": "2014-01-14T17:00:00.000+0100", "timeSpent": "PT3H" } ] } ]

Sprint

この例では、"New Sprint" という名前の新規スプリントが JSON ファイルから直接作成され、rapidViewId = 30 としてボードに追加されます。スプリントがクローズされている場合、state パラメーターにそのデータを含めます (任意)。スプリントの状態には以下のいずれかを使用できます。

• 「FUTURE」(既定値)
• 「ACTIVE」
• 「CLOSED」

アクティブなスプリントやクローズされたスプリントをインポートする際は、開始時刻と完了予定時刻を表す、開始日と終了日を指定する必要があります。クローズされたスプリントについては、完了日も指定する必要があります。

 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 Sprint { "projects": [ { "name": "Project", "key": "KEY", "issues": [ { "externalId": "51", "priority" : "High", "description" : "Test JSON import", "status" : "TO DO", "reporter" : "abcde-12345-fedcba", "issueType" : "Bug", "summary" : "Test JSON import", "customFieldValues": [ { "fieldName": "Sprint", "fieldType": "com.pyxis.greenhopper.jira:gh-sprint", "value": [ { "rapidViewId": 30, "state": CLOSED", "startDate": "2018-01-01", "endDate": "2018-01-01", "completeDate": "2018-01-01", "name": "New Sprint" } ] } ] } ] } ] }

日付の表現には、SimpleDateFormat "yyyy-MM-dd'T'HH:mm:ss.SSSZ" (出力例:  "2012-08-31T15:59:02.161+0100")、または "P-1D" (1 日前) などの相対日付を使用できます。

JSON File Import Wizard の実行

  1. [] > [システム] の順に選択します。

  2. [外部システム インポート] > [JSON] の順に選択します。

  3. JSON ファイルを選択し、インポートの開始をクリックします。

JSON ファイルがコメント付きの Jira Service Management プロジェクトで構成されている場合は、JSON インポート後にインポート ファイルのすべてのコメントが公開されます。

インポートで問題が生じた (または関心がある) 場合は、詳細なログをダウンロードするように選択して、JSON ファイルのインポート プロセスに関する詳細を表示できます。

その他のヘルプ