HOW TO ADD WEBHOOK IN BITBUCKET?

WHAT IS WEBHOOK?

There are many cases where an event happening in one system need to be informed to another system to trigger some related events/actions in the second system. Webhook is a web callback or HTTP push API, which will provide information and data about an event to other applications.

For example: Whenever new code gets committed (event) to a code repository (first system), you may want to setup a Webhookin the repository to run and alert the build and deployment tool (second system) to redeploy the application.

How to Add a Webhook in Bitbucket

Webhooks help in application integrations. Apps can subscribe to certain events in other systems and will get informed when such events happen in the subscribed system. In the above example, Build and Deployment Tool has subscribed for code commit events in the Code Repository System using Webhook.

ADDING A BITBUCKET WEBHOOK

Step 1: Login and select a Repository

Login to Bitbucket and navigate to your code repository. WordPress repository is selected as an example below.

How to Add a Webhook in Bitbucket

Step 2: Open Settings

Click on the Repository Settings tab to expand it and to view the Webhooksub menu

How to Add a Webhook in Bitbucket

Step 3: Open WebhookManagement Screen

Click on the Webhookmenu from the left menu panel to open the Webhookmanagement screen.

How to Add a Webhook in Bitbucket

Step 4: Edit/Add Webhook information

i) Click on the Add Webhook button in the Webhook management screen

How to Add a Webhook in Bitbucket

ii) Add the following information in the Add Webhook screen

  • Title:
  • URL: Webhook URL here >
  • SSL/TLS :
  • Trigger:
  • Click Savebutton.

How to Add a Webhook in Bitbucket

This will enable Bitbucket to send a POST request to the URL specified based on alerts set.

Now you have successfully completed setting up a Webhook for your Git repository.

Interested in reading similar articles?  Please follow us on LinkedIn.

About The Author

How to Add a Webhook in Bitbucket

Dr. Anil Kumar

VP Engineering, CLOUD CONTROL
Founder | Vice President | CTO | Architect | Consultant | Mentor | Advisor | Faculty

Solution Architect and IT Consultant with more than 25 years of IT Experience. Served various roles with both national and international institutions. Expertise in working with both legacy and advanced technology stacks and business domains.