Using webhooks

お困りですか?

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

コミュニティに質問

Bamboo webhooks allow you to send selected real-time information about Bamboo to third-party applications. For example, you can display Bamboo build status in your team's chatroom, or signal an alarm in case a plan fails. 

By default, Bamboo comes with two webhook templates that you can use:

  • Build webhook

    Show me the template...

    Method: POST

    Payload:

    {
      "uuid": "${bamboo.webhook.uuid}",
      "timestamp": "${bamboo.webhook.timestamp}",
      "notification": "${bamboo.webhook.notification.description}",
      "webhook": {
        "webhookTemplatedId": "${bamboo.webhook.template.id}",
        "webhookTemplatedName": "${bamboo.webhook.template.name}"
      },
      "build": {
        "buildResultKey": "${bamboo.buildResultKey}",
        "status": "${bamboo.buildState}",
        "buildPlanName": "${bamboo.buildPlanName}",
        "startedAt": "${bamboo.date.started}",
        "finishedAt": "${bamboo.date.finished}",
        "triggerReason": "${bamboo.trigger.reason}",
        "triggerSentence": "${bamboo.trigger.name.for.sentence}"
      }
    }

    Headers:

    content-type:application/json
  • Deployment webhook

    Show me the template...

    Method: POST

    Payload:

    {
      "uuid" : "${bamboo.webhook.uuid}",
      "timestamp" : "${bamboo.webhook.timestamp}",
      "notification" : "${bamboo.webhook.notification.description}",
      "webhook" : {
        "webhookTemplatedId" : "${bamboo.webhook.template.id}",
        "webhookTemplatedName" : "${bamboo.webhook.template.name}"
      },
      "deployment" : {
        "deploymentResultId" : "${bamboo.deploy.result.id}",
        "status" : "${bamboo.buildState}",
        "deploymentProjectId" : "${bamboo.deploy.project.id}",
        "environmentId" : "${bamboo.deploy.environment.id}",
        "environmentName": "${bamboo.deploy.environment.name}",
        "deploymentVersionId" : "${bamboo.deploy.version.id}",
        "deploymentVersionName" : "${bamboo.deploy.version.name}",
    
        "startedAt" : "${bamboo.date.started}",
        "finishedAt" : "${bamboo.date.finished}",
        "agentId" : "${bamboo.agentId}",
    
        "triggerReason" : "${bamboo.trigger.reason}",
        "triggerSentence" : "${bamboo.trigger.name.for.sentence}"
      }
    }

    Headers:

    content-type:application/json

You can modify the existing templates to suit your needs, or create your own templates, which can later be defined as notifications. 

If you're using webhooks in your deployments, you can check their status in the deployment details screen. Once you select the webhook details, you will see a table with all webhooks responses related to the current deployment. If you can't see the table, it means that no webhooks have been sent. 


The table is visible for all users who can see build results. The table contains basic information about webhook response: its status code, status, URL, event name, template name, send and receive time. Plan administrator has permissions to view webhook details: response header and body. If any secret variables are used in the URL, body or header, they will be hidden.

はじめる前に

Only Bamboo administrators can add, edit, and delete webhook templates. 

To create a webhook template:
  1. Select  > Communication > Webhook templates
  2. Select Add template.
  3. Provide the following details for your new webhook template:
    • 名前

    • Http Method

    • Payload 

    • Headers

      You can use Bamboo variables when editing webhook payload and headers.

  4. 追加 を選択します。 

Your webhook template is ready to use. You can define it as a notification type in your plan and jobs configuration, see Configuring notifications for a plan and its jobs

To edit a webhook template:
  1. Select  > Communication > Webhook templates
  2. Next to the webhook template you want to change, select the Edit button.
  3. Make your changes to the webhook template.
  4. 保存 を選択します。
To delete a webhook template:
  1. Select  > Communication > Webhook templates.
  2. Next to the webhook template you want to delete, select the Delete button.


最終更新日 2021 年 5 月 14 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.