• 製品
  • 使用を開始する
  • 関連ドキュメント
  • リソース

Opsgenie を Jira Service Management と統合する

Opsgenie が Jira Service Management ユーザーに提供するもの

Opsgenie は Jira Service Management との強力な双方向の統合を提供します。Jira Service Management で新しい課題が作成されると、課題に関する豊富な情報を含む Opsgenie アラートが自動で作成されます。Opsgenie はオンコール ローテーション、スケジューリング機能、アラート エスカレーションによる詳細な通知を提供して、Jira Service Management のお客様に最適なアラートおよびインシデント管理を保証します。ユーザーが承認やスヌーズなどのアクションをアラートに対して実行すると、Jira Service Management の課題はこれらのアラート アクションに関するコメントで自動で更新されます。ユーザーがアラートを閉じると、Jira Service Management の課題が解決済みになります (課題に [課題を解決] トランジションがある場合のみ)。

統合の機能性

Jira Service Management から Opsgenie へ:

  • Jira Service Management で課題が作成されたら、Opsgenie にアラートが作成されます。

  • Jira Service Management の課題にコメントが追加されると、同じコメントが Opsgenie のアラートにメモとして追加されます。

  • 課題がクローズされて Jira Service Management で解決されると、Opsgenie のアラートはクローズされます。

Opsgenie から Jira Service Management へ

  • [アラートの更新を Jira Service Management に返信] が有効な場合は、Jira Service Management 統合によって作成されたアラートに対して選択したアクションが Opsgenie で実行されると、Jira Service Management のアクションが Jira Service Management で実行されます。

  • [Opsgenie アラート用の Jira Service Management 課題を作成] が有効な場合は、Jira Service Management 統合以外のソースを持つアラートに対して選択したアクションが Opsgenie で実行されると、Jira Service Management のアクションが Jira Service Management で実行されます。

  • このアクション マッピング機能の詳細については、以下の「アクション マッピング機能」セクションで説明します。

Opsgenie で Jira Service Management インテグレーションを追加する

Opsgenie の Free プランまたは Essentials プランを使用している、または Jira Service Management の Standard プランで Opsgenie を使用している場合は、チーム ダッシュボードからのみこの統合を追加できます。このプランでは、[設定] の [統合] ページが利用できません。

  1. [チーム] に移動して自分のチームを選択します。

  2. 左側のナビゲーションで [統合] を選択し、[統合を追加] を選択します。

統合をチーム ダッシュボードから追加すると、そのチーム統合の所有者になります。Opsgenie では、この統合を通じて受信したアラートはそのチームのみに割り当てられます。このセクションの残りの手順に従って、統合を設定してください。

  1. [設定] > [統合] の順に移動します。Jira Service Management を検索して [追加] を選択します。

  2. [応答者] フィールドによって Jira Service Management アラートの通知先を指定します。入力し始めると、オートコンプリートの候補が表示されます。

  3. 統合 URL をコピーして、Jira Service Management 設定で使用します。

  4. [Save Integration (統合を保存)] をクリックします。

SSO の使用

SSO によって Jira にログインする場合は、API トークンを生成して統合設定のパスワードとして使用する必要があります。Jira で API トークンを生成する方法については「Atlassian アカウントの API トークンを管理する」をご参照ください。

新しいトークンを生成したら、Opsgenie の Jira 統合の [パスワード] フィールドにコピー & ペーストします。その後、統合を保存します。

 

アトラシアン アカウントを持っていないユーザー

REST API に対して認証を行っているユーザーで、アトラシアン アカウントを持っていないユーザーは、アカウントをアトラシアン アカウントに変換する必要があります。アトラシアン アカウントを変換する手順は、こちらからチェックできます。

アクション マッピング機能

  • Opsgenie では、Opsgenie と Jira Service Management の各アクション間のアクション マッピングを定義できます。

  • アクション マッピング機能を使用するには、以下に示す統合にいくつかの情報を提供します。

  • 課題タイプ名: Jira Service Management で定義された課題タイプ。例: タスク、IT ヘルプ、サブタスク、サービス リクエスト、またはその他のカスタム定義タイプ。課題タイプの構文はエラーがないように記述してください。

  • Jira Service Management URL: サービスのドメイン名。例: https://testops.atlassian.net

  • ユーザー名: Jira Service Management へのログインに使用するメール アドレス。

  • パスワード/API トークン: Jira Service Management へのログインに使用するパスワードまたは API トークン。

  • プロジェクト キー: アラートを作成するプロジェクトのキー。例: OT、OPS、SIT。プロジェクト キーは通常大文字ですので、正しい形式で記述してください。

Jira Service Management によって作成されたアラートの場合

  • このセクションによって、アラートのソースが Jira Service Management である際は Opsgenie のアクションを Jira Service Management のアクションにマッピングできます (アラートが Jira Service Management 統合によって作成された場合)。

  • さまざまな Opsgenie アクションをさまざまな Jira Service Management アクションにマッピングできます。たとえば、アラートが承認された際に Jira Service Management の課題にメモを追加できます。そのためには、[アラートが OpsGenie で承認された場合は、Jira Service Management で課題にコメントとして追加] マッピングを[アラートの更新を Jira Service Management に返信] セクションで定義する必要があります。

JSM チェックボックスによって作成されたアラートのアクション マッピングを示すスクリーンショット。

Opsgenie のその他のアラートの場合

  • このセクションによって、アラートのソースが Jira Service Managementない際は Opsgenie のアクションを Jira Service Management のアクションにマッピングできます (アラートが別の統合によって作成された場合)。

  • このために、[Opsgenie アラート用の Jira Service Management 問題を作成] セクションを使用できます。この機能を使用するには、1 つの Opsgenie アクションを課題の作成 Jira Service Management アクションにマッピングする必要があります。Opsgenie アクションは「アラートが作成される」である必要はなく、他のアクションにもできます。

  • アラートにタグが追加され、他のアクションとは異なるアラート アクションに対してカスタム アクションが実行されます。これらのアクションのいずれかを選択すると、このマッピングが機能するタグまたはカスタム アクションを入力するための追加のフィールドが追加されます。

  • タグをカンマで区切って、複数のタグを入力します。複数のタグを入力した場合、マッピングは、指定されたタグが 1 つ以上アラートにある場合に機能します。どのタグでもマッピングが機能するには、[タグ] フィールドを空のままにします。

  • Opsgenie アクションが複数の Jira Service Management アクションにマッピングされている場合は、「タグがアラートに追加される」と「カスタム アクションがアラートに対して実行される」の各アクションを除いて、エラーが発生します。マッピングが特定のタグとカスタム アクション名によって異なるため、これらのアクションに対する複数のマッピングを保存します。

他の Opsgenie アラート チェックボックスのアクション マッピングを示すスクリーンショット。

Jira Service Management での設定

  1. 管理者として Jira にログインします。

  2. ダッシュボードから [管理] メニューを開きます。[システム] を選択します。

  3. 左側の [詳細設定] の下の [Webhook] を選択します。

Opsgenie インテグレーションのために JSM から webhook にアクセスしていることを示すスクリーンショット。

4. [Webhook の作成] をクリックします。開いたセクションで、Opsgenie の Jira インテグレーションによって提供された URL を URL 入力に貼り付けます。[作成] をクリックします。

5. [本文を除外] チェックボックスがオフになっていることを確認します。

スクリーンショット: JSM Webhook リスナーの本文を除外するチェックボックス
Opsgenie インテグレーション用に JSM から webhook を作成する方法を示すスクリーンショット。

Jira Service Management アラートを Opsgenie で管理して、そのアラート機能をフル活用しましょう。

Jira Service Management から送信されたペイロードの例

アラートのペイロードを作成します。

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 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 { "issue": { "id": "10042", "self": "https://test.atlassian.net/rest/api/2/issue/10042", "key": "TEST-43", "fields": { "issuetype": { "self": "https://test.atlassian.net/rest/api/2/issuetype/10000", "id": "10000", "description": "For system outages or incidents. Created by JIRA Service Management.", "iconUrl": "https://test.atlassian.net/servicedesk/issue-type-icons?icon=incident", "name": "Incident", "subtask": false }, "timespent": null, "project": { "self": "https://test.atlassian.net/rest/api/2/project/10000", "id": "10000", "key": "TEST", "name": "Test", "avatarUrls": { "48x48": "https://test.atlassian.net/secure/projectavatar?avatarId=10324", "24x24": "https://test.atlassian.net/secure/projectavatar?size=small&avatarId=10324", "16x16": "https://test.atlassian.net/secure/projectavatar?size=xsmall&avatarId=10324", "32x32": "https://test.atlassian.net/secure/projectavatar?size=medium&avatarId=10324" } }, "fixVersions": [], "aggregatetimespent": null, "resolution": null, "customfield_10027": { "id": "1", "name": "Time to resolution", "_links": { "self": "https://test.atlassian.net/rest/servicedeskapi/request/10042/sla/1" }, "completedCycles": [ { "startTime": { "iso8601": "2016-06-27T11:25:37+0300", "jira": "2016-06-27T11:25:37.877+0300", "friendly": "Today 11:25 AM", "epochMillis": 1467015937877 }, "stopTime": { "iso8601": "2016-06-27T11:37:33+0300", "jira": "2016-06-27T11:37:33.572+0300", "friendly": "Today 11:37 AM", "epochMillis": 1467016653572 }, "breached": false, "goalDuration": { "millis": 14400000, "friendly": "4h" }, "elapsedTime": { "millis": 715695, "friendly": "11m" }, "remainingTime": { "millis": 13684305, "friendly": "3h 48m" } } ], "ongoingCycle": { "startTime": { "iso8601": "2016-06-27T16:01:45+0300", "jira": "2016-06-27T16:01:45.920+0300", "friendly": "Today 4:01 PM", "epochMillis": 1467032505920 }, "breachTime": { "iso8601": "2016-06-28T12:01:45+0300", "jira": "2016-06-28T12:01:45.920+0300", "friendly": "28/Jun/16 12:01 PM", "epochMillis": 1467104505920 }, "breached": false, "paused": false, "withinCalendarHours": true, "goalDuration": { "millis": 14400000, "friendly": "4h" }, "elapsedTime": { "millis": 197118, "friendly": "3m" }, "remainingTime": { "millis": 14202882, "friendly": "3h 56m" } } }, "customfield_10028": { "id": "2", "name": "Time to first response", "_links": { "self": "https://test.atlassian.net/rest/servicedeskapi/request/10042/sla/2" }, "completedCycles": [ { "startTime": { "iso8601": "2016-06-27T11:25:37+0300", "jira": "2016-06-27T11:25:37.877+0300", "friendly": "Today 11:25 AM", "epochMillis": 1467015937877 }, "stopTime": { "iso8601": "2016-06-27T11:37:33+0300", "jira": "2016-06-27T11:37:33.572+0300", "friendly": "Today 11:37 AM", "epochMillis": 1467016653572 }, "breached": false, "goalDuration": { "millis": 14400000, "friendly": "4h" }, "elapsedTime": { "millis": 715695, "friendly": "11m" }, "remainingTime": { "millis": 13684305, "friendly": "3h 48m" } } ] }, "resolutiondate": null, "workratio": -1, "lastViewed": "2016-06-27T16:01:46.447+0300", "watches": { "self": "https://test.atlassian.net/rest/api/2/issue/TEST-43/watchers", "watchCount": 1, "isWatching": true }, "created": "2016-06-27T11:25:37.859+0300", "customfield_10020": "Not started", "customfield_10021": null, "customfield_10022": null, "priority": { "self": "https://test.atlassian.net/rest/api/2/priority/3", "iconUrl": "https://test.atlassian.net/images/icons/priorities/medium.svg", "name": "Medium", "id": "3" }, "customfield_10023": [], "customfield_10024": null, "customfield_10025": null, "labels": [], "customfield_10026": null, "customfield_10016": null, "customfield_10017": null, "customfield_10018": null, "customfield_10019": null, "timeestimate": null, "aggregatetimeoriginalestimate": null, "versions": [], "issuelinks": [], "assignee": null, "updated": "2016-06-27T16:05:02.852+0300", "status": { "self": "https://test.atlassian.net/rest/api/2/status/10001", "description": "This was auto-generated by JIRA Service Desk during workflow import", "iconUrl": "https://test.atlassian.net/images/icons/status_generic.gif", "name": "Waiting for support", "id": "10001", "statusCategory": { "self": "https://test.atlassian.net/rest/api/2/statuscategory/1", "id": 1, "key": "undefined", "colorName": "medium-gray", "name": "No Category" } }, "components": [], "timeoriginalestimate": null, "description": "test description", "customfield_10010": null, "customfield_10011": null, "customfield_10012": null, "customfield_10013": null, "customfield_10014": null, "timetracking": {}, "customfield_10015": null, "customfield_10007": "0|i0009b:", "customfield_10008": "com.atlassian.servicedesk.plugins.approvals.internal.customfield.ApprovalsCFValue@cf82e6", "attachment": [], "customfield_10009": null, "aggregatetimeestimate": null, "summary": "New Summary", "creator": { "self": "https://test.atlassian.net/rest/api/2/user?username=admin", "name": "admin", "key": "admin", "emailAddress": "email@emailserver.tld", "avatarUrls": { "48x48": "https://secure.gravatar.com/avatar/asd0a6bb5e5c8ce4c5152b54b45ee5c?d=mm&s=48", "24x24": "https://secure.gravatar.com/avatar/asd0a6bb5e5c8ce4c5152b54b45ee5c?d=mm&s=24", "16x16": "https://secure.gravatar.com/avatar/asd0a6bb5e5c8ce4c5152b54b45ee5c?d=mm&s=16", "32x32": "https://secure.gravatar.com/avatar/asd0a6bb5e5c8ce4c5152b54b45ee5c?d=mm&s=32" }, "displayName": "Administrator", "active": true, "timeZone": "Europe/Helsinki" }, "subtasks": [], "reporter": { "self": "https://test.atlassian.net/rest/api/2/user?username=admin", "name": "admin", "key": "admin", "emailAddress": "email@emailserver.tld", "avatarUrls": { "48x48": "https://secure.gravatar.com/avatar/asd0a6bb5e5c8ce4c5152b54b45ee5c?d=mm&s=48", "24x24": "https://secure.gravatar.com/avatar/asd0a6bb5e5c8ce4c5152b54b45ee5c?d=mm&s=24", "16x16": "https://secure.gravatar.com/avatar/asd0a6bb5e5c8ce4c5152b54b45ee5c?d=mm&s=16", "32x32": "https://secure.gravatar.com/avatar/asd0a6bb5e5c8ce4c5152b54b45ee5c?d=mm&s=32" }, "displayName": "Administrator", "active": true, "timeZone": "Europe/Helsinki" }, "customfield_10000": null, "aggregateprogress": { "progress": 0, "total": 0 }, "customfield_10001": null, "customfield_10002": null, "customfield_10003": null, "environment": null, "duedate": null, "progress": { "progress": 0, "total": 0 }, "comment": { "comments": [ { "self": "https://test.atlassian.net/rest/api/2/issue/10042/comment/10027", "id": "10027", "author": { "self": "https://test.atlassian.net/rest/api/2/user?username=admin", "name": "admin", "key": "admin", "emailAddress": "email@emailserver.tld", "avatarUrls": { "48x48": "https://secure.gravatar.com/avatar/asd0a6bb5e5c8ce4c5152b54b45ee5c?d=mm&s=48", "24x24": "https://secure.gravatar.com/avatar/asd0a6bb5e5c8ce4c5152b54b45ee5c?d=mm&s=24", "16x16": "https://secure.gravatar.com/avatar/asd0a6bb5e5c8ce4c5152b54b45ee5c?d=mm&s=16", "32x32": "https://secure.gravatar.com/avatar/asd0a6bb5e5c8ce4c5152b54b45ee5c?d=mm&s=32" }, "displayName": "Administrator", "active": true, "timeZone": "Europe/Helsinki" }, "body": "test comment", "updateAuthor": { "self": "https://test.atlassian.net/rest/api/2/user?username=admin", "name": "admin", "key": "admin", "emailAddress": "email@emailserver.tld", "avatarUrls": { "48x48": "https://secure.gravatar.com/avatar/asd0a6bb5e5c8ce4c5152b54b45ee5c?d=mm&s=48", "24x24": "https://secure.gravatar.com/avatar/asd0a6bb5e5c8ce4c5152b54b45ee5c?d=mm&s=24", "16x16": "https://secure.gravatar.com/avatar/asd0a6bb5e5c8ce4c5152b54b45ee5c?d=mm&s=16", "32x32": "https://secure.gravatar.com/avatar/asd0a6bb5e5c8ce4c5152b54b45ee5c?d=mm&s=32" }, "displayName": "Administrator", "active": true, "timeZone": "Europe/Helsinki" }, "created": 1467032702852, "updated": 1467032702852 } ], "maxResults": 1, "total": 1, "startAt": 0 }, "votes": { "self": "https://test.atlassian.net/rest/api/2/issue/TEST-43/votes", "votes": 0, "hasVoted": false }, "worklog": { "startAt": 0, "maxResults": 20, "total": 0 } } }, "timestamp": 1467032703044 }

OEC を介したインテグレーション (オンプレミスの Jira Service Management の用途用)

現在、Jira Service Desk は Jira Service Management になりました。製品名は変更されている可能性がありますが、次の更新まで、スクリプトでは古い名前 (Jira Service Desk) を引き続き使用します。

Opsgenie の OEC と Jira ServiceDesk スクリプトによって、Jira Service Management でリクエストを更新します。これによって独自のスクリプトや機能をデプロイすることで、事前に提供された機能を変更したり、カスタマイズしたアクションを Jira Service Management 上で実行したりできるようになります。

Jira ServiceDesk インテグレーション パッケージを使用するには、以下のセクションのステップを最後まで実行します。

OEC の最新バージョンをダウンロードする

JiraServiceDesk パッケージの最新バージョンをダウンロードするには、oec-scripts リポジトリの readme ファイルを使用してください。

 

インストール

Red Hat ベースのディストリビューションの場合

  • 次のコマンドを実行します。rpm -i opsgenie-jiraservicedesk-<your_version>.rpm

Debian ベースのディストリビューションの場合

  • 次のコマンドを実行します。dpkg -i opsgenie-jiraservicedesk-<your_version>.deb

Windows の場合

  • OEC パッケージを含む opsgenie jiraservicedesk の zip ファイルをディレクトリ内に解凍します (C:\opsgenie は優先パスです)。Windows に OEC をインストールするには、こちらの指示に従います。

  • OEC の実行方法について詳しくは、OEC の実行のドキュメントを参照してください。

OEC 用の Jira Service Management インテグレーションの設定

  • OEC ユーティリティを使用するには、[OEC 経由で送信] を有効にします

  • Jira Service Management に関するその他の設定は、統合ページ、または OEC 設定ファイルの config.json を介して行えます。統合ページを介した設定は、設定ファイルより優先されます。

Opsgenie の JSM インテグレーションで他の設定を実施する場所を示すスクリーンショット。

OEC 設定

Jira Software でアクションを実行できるように、OEC は /home/opsgenie/oec/conf/config.json にある設定ファイル設定パラメーターを取得します。

設定パラメーター

  • apiKey — 上記で作成した Jira インテグレーションから API キーをコピーします。

  • issueTypeName – 問題のタイプ。「タスク」、「バグ」、「ストーリー」、またはカスタム問題タイプ (「エピック」はサポートされていません) があります。

  • url – 問題の作成、解決、クローズなどが行われる Jira Service Management の URL。

  • username – Jira Service Management アカウントのユーザー名。

  • password – Jira Service Management アカウントのパスワード。

  • key – このプロジェクトには問題が作成されます。

また、ダウンロードしたパッケージには、/usr/local/bin にある OEC ユーティリティと、/home/opsgenie/oec/scripts にある OEC によって実行する必要があるスクリプトが含まれています。OEC の設定が完了したら、OEC を実行する必要があります。OEC を実行する方法に関する詳細については、OEC の実行のドキュメントをご参照ください。

OEC に送信されるパラメーターの例

JSON

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 { "summary":"test", "issueTypeName":"Task", "integrationName":"Jira Service Management", "sendViaOEC":true, "description":"this is a test", "integrationId":"3af28c92-b71c-459c-8d72-04a6f7f7ebac", "url":"https://jiratestopsgenie.atlassian.net", "password":"******", "projectKey":"OPSGENIE", "integrationType":"JiraServiceDesk", "customerId":"04912a27-5fc1-4145-a6dd-8819afc0d870", "alias":"c570a4cc-3f57-4b60-814e-f04c63e7442d", "action":"Create", "alertId":"c570a4cc-3f57-4b60-814e-f04c63e7442d", "key":null, "mappedAction":"createIssue", "username":"jiratest@opsgenie.com" }

トラブルシューティング

  1. Jira Service Management で課題を作成するために必須のカスタム フィールドが設定されている場合は、Opsgenie アラートから Jira Service Management の課題を作成できません。ただし、OEC によってスクリプトを設定することで、Jira リクエストを作成できます。

  2. アラートに対してアクションを実行しても問題にコメントを追加できない場合は、まず [ログ] ページを参照してください。URL に問題キーが含まれていない場合は、そのアラートから入力された Jira Service Management に問題がないことを意味します。したがって、存在しない問題にはコメントを追加できません。

  3. Opsgenie の Jira Service Management 統合によって、Jira Service Management で課題のステータスを [解決済み] に設定できます。ただし、プロジェクトのワークフローでトランジションが許可されていない場合は、Opsgenie によってトランジションは設定できません

  4. Jira Service Management は ASCII 以外の文字をサポートしていません。ペイロードで ASCII 以外の文字を Jira Service Management に送信すると、400 不正なリクエスト エラーが発生する可能性があります。

  5. Jira Service Management 統合がチームに割り当てられている場合、Opsgenie で作成されたアラートから Jira Service Management で課題を作成するには、他の統合も同じチームに割り当てる必要があります。そうでなければ、Jira Service Management 統合と他の Opsgenie 統合の両方にチームを割り当てないでください。

  6. Opsgenie アラートから Jira Service Management リクエストの作成を試みた後にアクティビティ ログで「理由: 400 不正なリクエストエラーを受信した場合は、[ログ] ページでこの応答の詳細をご確認ください。[ログ] ページに表示されるエラーの例: "labels":"フィールド 'labels' は設定できません。適切な画面上にないか不明です"。これを解決するには、Jira Service Management アカウントに移動してプロジェクト設定から欠落しているフィールドを追加します。

その他のヘルプ