• 使用を開始する
  • 関連ドキュメント

Opsgenie を Jira Service Management と統合する

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

Opsgenie provides a powerful two-way integration with Jira Service Management. When a new issue is created in Jira Service Management, a corresponding Opsgenie alert is automatically created, containing rich information about the issue. Opsgenie provides rich notifications with on-call rotations, scheduling features, and alert escalations to ensure the best alert and incident management for Jira Service Management customers. As users execute actions on the alerts, like acknowledge or snooze, the issue in Jira Service Management automatically updates with comments about these alert actions. If users close the alert, the issue in Jira Service Management is resolved (Only if the issue has a Resolve the issue transition).

統合の機能性

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. Go to Settings > Integrations. Search for Jira Service Management and select Add.

  2. Specify who is notified of Jira Service Management alerts using the Responders field. Auto-complete suggestions are provided as you type.

  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 のその他のアラートの場合

  • You can use this section to map Opsgenie actions to Jira Service Management actions when the source of the alert is NOT Jira Service Management (i.e When the alert is created by another integration.)

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

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

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

  • If an Opsgenie action is mapped to multiple Jira Service Management actions, an error occurs except for the a tag is added to the alert and a custom action is executed on alert actions. Save multiple mappings for these actions because they differ by the given tags and the given custom action names.

他の 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

{ "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 の最新バージョンをダウンロードする

To download the latest version of JiraServiceDesk package, please use readme file of oec-scripts repository.

 

インストール

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

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

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

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

Windows の場合

  • Unzip opsgenie jiraservicedesk zip file which contains OEC package into a directory (C:\opsgenie is the preferred path.) Follow the instructions here to install OEC on Windows.

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

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

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

  • Other configurations regarding Jira Service Management can be done either via integration page or OEC configuration file config.json. The configuration via the integration page precedes the configuration file.

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

OEC 設定

To be able to execute actions in Jira, OEC gets the configuration parameters from the configuration file located at path /home/opsgenie/oec/conf/config.json.

設定パラメーター

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

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

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

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

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

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

The package that you downloaded also includes OEC utility which is located under /usr/local/bin and the script that is needed to be run by OEC which is under /home/opsgenie/oec/scripts. After the configuration of OEC is done, you need to run it. In order to learn more about how to run OEC, you can refer to the Running OEC documentation.

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

JSON

{ "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. If a mandatory custom field is set for creating an issue in Jira Service Management, a Jira Service Management issue cannot be created from an Opsgenie alert. However, by using OEC and configuring the script, the creation of Jira request can be achieved.

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

  3. Opsgenie's Jira Service Management integration allows setting the status of the issue to RESOLVED in Jira Service Management. However, if the workflow of the project does not allow that transitions, you cannot set that transition using Opsgenie too.

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

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

  6. If you receive a Reason: 400 Bad Request error in the activity logs after attempting to create a Jira Service Management request from an Opsgenie alert, check the Logs page for detailed information on this response. An example pf the error you may see in the Logs page is: "labels":"Field 'labels' cannot be set. It is not on the appropriate screen, or unknown". To resolve this go to your Jira Service Management account and add the missing field from project settings.

さらにヘルプが必要ですか?

アトラシアン コミュニティをご利用ください。