Support triggering Bitbucket service hooks based on a filter of branches and tags (BB-4476)

Issue #5759 open
Marcus Bertrand
staff created an issue

Newer versions of build systems such as Bamboo and Jenkins support being able to build from specific branches. The services on Bitbucket should be able to be filtered to trigger only on pushes involving specific branches/tags.

Comments (18)

  1. Shay Erlichmen

    Here is how we worked around the limitation:

    1. Install Build Token Root Plugin so that we can trigger builds using tokens override Jenkins security.
    2. In the Jenkins project assign token to the project and select pull scm, don't assign any value for the pull interval..
    3. Wrote a ngnix rule that redirect from the build url to the pull url.
        location ~ ^/job/.*/build$ {
            if ($arg_token = "") {
               proxy_pass http://app_server;
            rewrite /job/(.*)/build$ /buildByToken/polling?job=$1 last;

    We check that token is passed otherwise use the default routing so that builds from the console would still work.

  2. Craig Ogle

    We would be very interested in a solution to this, too. We want to trigger a Bamboo build, but only when a branch within the repository changes. We had to move to polling from Bamboo Build Plan rather than triggering a Build Plan Branch to process when a Bitbucket branch is updated. We would rather use a trigger from Bitbucket, but not trigger when ANY branch is updated. (Currently using Bamboo version 5.5.1. We are upgrading to latest version later this month.)

  3. Mush

    My repository has two major branches, online branch and test branch. I need to deploy each branch on different environment, for now I can not tell which branch is changed from web hook, so I have to deploy both, that's really Nasty.

  4. Log in to comment