Triggering a Bamboo build from Bitbucket Cloud using Webhooks


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


Webhooks provide a way to configure Bitbucket Cloud to make requests to your server (or another external service) whenever certain events occur in Bitbucket Cloud. The purpose of this guide is to help you set up a Webhook that will trigger a Bamboo build from Bitbucket Cloud after a certain event. For example, you may want Bitbucket Cloud to trigger a Bamboo build when your repository receives a commit (aka post-commit trigger).


  1. First configure the Bamboo plan to trigger with a Remote trigger: BambooPlan Configuration > Triggers > Add trigger > Remote trigger.
  2. Bamboo requires you to whitelist the IP addresses of the source of the request to trigger underthe Trigger IP Addresses field (comma separated for each IP).
    1. The current list of Bitbucket Cloud IP addresses for outbound POST requests by Webhooks: Bitbucket Cloud IP Addresses
    2. CIDR Notation is only supported in Bamboo 5.14+
    3. Bamboo's IP whitelist also inspects the X-Forwarded-For HTTP header to determine the origin of the request. If you have a reverse proxy forwarding requests to your Bamboo instance, depending onit's configuration, you may also need to whitelist the IP address of the Proxy Server.
  3. Add a Webhook to your Bitbucket Cloud repository: Bitbucket Cloud > Repository > Settings > Webhooks > Add Webhook
    1. Title: Choose any title for your Webhook that aptly describes it.
    2. URL: Enter the URL of the Bamboo API to trigger a plan:  

      http://<your bamboo host>/api/rest/updateAndBuild.action?buildKey=<PLAN-KEY>

      1. Replace <your bamboo host> with the URL of your Bamboo instance.
      2. Replace PLAN-KEY with the key of the plan you wish to trigger. The PLAN-KEY  is visible in the URL when browsing the plan in Bamboo. E.g.
    3. Triggers: Choose the event(s) you want the Webhook to activate on. E.g. Repository Push.
    4. Save.

That's it! If you find your Webhook doesn't appear to be working – the best place to start troubleshooting is by viewing the request and response at Bitbucket Cloud > Repository > Settings > Webhooks > View requests.

最終更新日: 2017 年 12 月 19 日


Powered by Confluence and Scroll Viewport.