Integrate an automation rule with Microsoft Teams and Jira Data Center

プラットフォームについて: Data Center のみ。 - This article only applies to Atlassian apps on the Data Center プラットフォーム

この KB は Data Center バージョンの製品用に作成されています。Data Center 固有ではない機能の Data Center KB は、製品のサーバー バージョンでも動作する可能性はありますが、テストは行われていません。 Server* 製品のサポートは 2024 年 2 月 15 日に終了しました。Server 製品を実行している場合は、 アトラシアン Server サポート終了 のお知らせにアクセスして、移行オプションを確認してください。

*Fisheye および Crucible は除く

要約

この手順では、自動化ルールを Microsoft (MS) Teams チャンネルに統合して Jira 課題に関する通知を表示する方法をご説明します。

Jira から MS Teams チャンネルにメッセージを送信するには、まず Microsoft Teams と Jira 自動化を統合する必要があります。この統合により、自動化が MS Teams チャンネルにメッセージを送信するために使用する Webhook URL が提供されます。この統合はいつでも取り消せます。

ソリューション

Microsoft Teams の統合をセットアップするには、Jira Webhook をリッスンするフロー チェーンを作成する必要があります。

  1. Microsoft Teams に移動して、チャンネル名の横にある [その他のオプション (...)] > [ワークフロー] の順に選択します。

    MS Teams ワークフロー セレクション

  2. [その他のワークフロー] を選択し、次に [白紙から作成] を選択します。

  3. [Search connectors and triggers (コネクタとトリガーを検索)] フィールドに、「Webhook」と入力します。

  4. [トリガー] で、[When a Teams webhook request is received (Teams Webhook リクエストを受信したとき)] トリガーを選択します。

    1. [Who can trigger the flow (フローをトリガーできるユーザー)] ドロップダウンで [全員] を選択します。

  5. [新しいステップ] を選択して、[アクション] で [JSON の解析] を検索して、このオプションを選択します。

    1. [コンテンツ] フィールドに「@{triggerBody()}」と入力します。

    2. "スキーマ" フィールドに、次の JSON スキーマを追加します。

      { "type": "object", "properties": { "summary": { "type": "string" }, "sections": { "type": "array", "items": { "type": "object", "properties": { "activityTitle": { "type": "string" }, "activitySubtitle": { "type": "string" }, "activityImage": { "type": "string" }, "activityText": { "type": "string" }, "facts": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "value": { "type": "string" } }, "required": [ "name", "value" ] } } }, "required": [ "activityTitle" ] } }, "potentialAction": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "targets": { "type": "array", "items": { "type": "object", "properties": { "uri": { "type": "string" }, "os": { "type": "string" } }, "required": [ "uri", "os" ] } }, "@@type": { "type": "string" } }, "required": [ "name", "targets", "@@type" ] } }, "themeColor": { "type": "string" }, "@@context": { "type": "string" }, "@@type": { "type": "string" } } }

  6. Select New Step, search for Card, and then select Post card in a chat or channel under Actions. Then:

    1. [Post in (投稿の場所)] ドロップダウンで、[チャンネル] を選択します。

    2. [チーム] と [チャンネル] の各ドロップダウンで、通知を投稿するチームとチャンネルを選択します。

      チャンネルに MS Teams カードを投稿する
  7. "アダプティブ カード" フィールドに次の JSON を追加します。

    { "type": "AdaptiveCard", "body": [ { "type": "ColumnSet", "columns": [ { "type": "Column", "items": [ { "type": "TextBlock", "weight": "Bolder", "text": "@{body('Parse_JSON')['sections'][0]['activityTitle']}", "wrap": true } ], "width": "stretch" } ] }, { "type": "TextBlock", "text": "@{body('Parse_JSON')['sections'][0]['activityText']}", "wrap": true }, { "type": "TextBlock", "weight": "Bolder", "text": "@{body('Parse_JSON')['sections'][1]['activityTitle']}", "wrap": true }, { "type": "ColumnSet", "columns": [ { "type": "Column", "items": [ { "type": "TextBlock", "weight": "Bolder", "text": "@{body('Parse_JSON')['sections'][1]['facts'][0]['name']}", "wrap": true } ], "width": "auto" }, { "type": "Column", "width": "auto", "items": [ { "type": "RichTextBlock", "horizontalAlignment": "Right", "inlines": [ { "type": "TextRun", "text": "@{body('Parse_JSON')['sections'][1]['facts'][0]['value']}" } ] } ], "verticalContentAlignment": "Center" } ] }, { "type": "ColumnSet", "columns": [ { "type": "Column", "items": [ { "type": "TextBlock", "weight": "Bolder", "text": "@{body('Parse_JSON')['sections'][1]['facts'][1]['name']}", "wrap": true } ], "width": "auto" }, { "type": "Column", "width": "auto", "items": [ { "type": "RichTextBlock", "horizontalAlignment": "Right", "inlines": [ { "type": "TextRun", "text": "@{body('Parse_JSON')['sections'][1]['facts'][1]['value']}" } ] } ], "verticalContentAlignment": "Center" } ] }, { "type": "ColumnSet", "columns": [ { "type": "Column", "items": [ { "type": "TextBlock", "weight": "Bolder", "text": "@{body('Parse_JSON')['sections'][1]['facts'][2]['name']}", "wrap": true } ], "width": "auto" }, { "type": "Column", "width": "auto", "items": [ { "type": "RichTextBlock", "horizontalAlignment": "Right", "inlines": [ { "type": "TextRun", "text": "@{body('Parse_JSON')['sections'][1]['facts'][2]['value']}" } ] } ], "verticalContentAlignment": "Center" } ] } ], "actions": [ { "type": "Action.OpenUrl", "title": "@{body('Parse_JSON')['potentialAction'][0]['name']}", "url": "@{body('Parse_JSON')['potentialAction'][0]['targets'][0]['uri']}" } ], "$schema": "http://adaptivecards.io/schemas/adaptive-card.json", "version": "1.5" }

  8. ステップ チェーンがスクリーンショットのようになっていることを確認して、[保存] を選択します。

    MS Teams のワークフロー設定

  9. クリップボードに Webhook URL をコピーします。

    データを送信できるように、Webhook ドメインを許可リストに追加します。追加しないと、Webhook がブロックされる可能性があります。

    MS Teams の Webhook URL をコピーする

Webhook URL を Jira に貼り付ける

次の手順は、使用している Automation For Jira のバージョンによって異なります。

  1. 9.0.0 より前のバージョンの Automation For Jira

    1. 自動化ルールと [Send Microsoft Teams Notification (Microsoft Teams 通知を送信)] アクションに移動します。

    2. ステップ 4 の Webhook URL を [Webhook URL] フィールドに貼り付けます。

      Microsoft Teams メッセージの Webhook URL

  2. 9.0.0 以降のバージョンの Automation For Jira

    1. こちらのドキュメンテーションの指示に従い、Microsoft Teams インターフェイスから取得した Webhook URL を使用して新しいシークレット キーを作成します。

    2. 自動化ルールと [Send Microsoft Teams Notification (Microsoft Teams 通知を送信)] アクションに移動します。

    3. [Webhook URL] ドロップダウン メニューをクリックし、先ほど作成したシークレット キーを選択します。

      Microsoft Teams と Jira を統合するためのシークレット キー

設定完了です! Microsoft Teams チャンネルと統合されました。

マークダウンのサポート

Microsoft Team メッセージでは、基本的なリッチ フォーマットのマークダウンをサポートしています。ただし、以下を挿入することはできません。

  • 画像

  • インライン HTML

  • HTML ブロック

  • カスタム ノード

ヒント

# や * などの特殊文字を文字としてメッセージ中に表示する場合は、文字をエスケープする必要があります。エスケープされていない特殊文字は、マークダウン関数として扱われます。文字をバックスラッシュで囲んでエスケープできます (例: \#\)。

バグが発生したら、Microsoft Teams チャンネルにメッセージを送信します。

Ms Teams 経由でバグが報告されたときにチームにアラートを送信する自動化

メッセージ本文では、マークダウン言語でフォーマットされたスマート値を使用しています。

自動化の Teams メッセージの内容

このルールがトリガーされると、Microsoft Teams 内のメッセージは次のように表示されます。

Automation for Jira によって送信されるサンプル Teams メッセージ

これで完了です。Microsoft Teams でメッセージを送信できるようになりました。

更新日時: 2025年05月26日)

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

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