Skip to end of metadata
Go to start of metadata

Bitbucket offers integration with external services via a set of brokers. Each broker is a server-side post-receive service. After the server receives and finishes processing a push, it passes data to the services you choose.  A broker is a simple Python script, that receives information about the push and then takes action. For example, there is a broker for sending email messages, another for posting information to an arbitrary URL, and another for posting updates to a Twitter account. This page contains the following information:

If you are having trouble with an existing service, see Troubleshoot Bitbucket services.

What triggers a post-receive service?

A service runs once Bitbucket receives data from you and other contributors to your project. Because of the decentralised nature of Git and Mercurial, you can commit something locally without notifying Bitbucket. It is not until you push your changesets to Bitbucket, that you actually connect to our servers and upload the commit data.  

A service broker receives the push data only after the Bitbucket server successfully receives it.  Since a push can contain multiple changesets, a service may receive more than one changeset. Some of the services take the number of changsets into consideration. For example, the email broker constructs different email messages based on the number of changesets.

Setting up a service

A repository administrator can enable services for a specific repository. Once you've configured a service, it is active.

  1. Go to the repository settings .
  2. Click Services on the right-hand side of the screen.
    On the page, you will see a list (Select a service) of services available. You may add as many services as you want. You can even add many instances of the same type. For example, you can email several people or ping several different URLs.
  3. Select the service you want.
  4. Click Add service.
    The system adds the service to the page. 
  5. Scroll to the service you added.
  6. Enter additional configuration information as needed.
    Details are in the separate sections per service, listed below.
  7. Click Save.

Available services

Follow the detailed instructions to set up the services you want:

7 Comments

  1. Anonymous

    Does the server run on pull requests?

  2. Can I use commit-msg, pre-commit or pre-push?

    I can't fine it on Hooks setting page.

    I want apply the commit message rules that must insert JIRA Number in commit message when commit or push.

    thanks

    1. Hello Rickie,

      Thanks for taking the time to comment and sorry it's taken me so long to reply.

      I'm not sure there is a way to enforce that rule in Bitbucket through a hook, at least I haven't found a way, but I'll look a little more at the Bamboo hook to see if that's possible. You can raise it as a feature request by submitting an issue.

       

  3. Could you please update this page to remove the hint that users can submit their own hook implementations?

    Also really helpful would be to link to the list of known issues with hooks, especially problems that make these hooks worthless in many cases:

    https://bitbucket.org/site/master/issues?status=new&status=open&component=Hooks&sort=-votes

    https://bitbucket.org/site/master/issue/7775/post-service-does-not-provide-useful

    1. Good day Bob,

      Thank you for taking the time to comment. I've updated the page and removed the section referring to submitting new hooks. I will look into linking to the issues list.

      Thanks again