Currently you cannot setup a webhook with Bitbucket Server, even though you have support for Bitbucket.org, which creates an issue when trying to get builds to trigger after a push to a repository.
Once added (and accepted) there, it will just work. If anyone have the time to implement it, we’d be glad to review & merge it, the README of the repository should cover every step required for developing the change, and you can even run your own version of the webhook server.
Right now we don’t have access to a Bitbucket Server instance, but if anyone can help us, either by letting us use one or to test a couple of things with us, we can also schedule to work on this.
It seems the recent Bitbucket Server v5.4 added support for the Bitbucket V2 webhook support, the one we support for Bitbucket.org, but there’s a minor difference:
If anyone has some time before we could work on that, PRs are welcome
Seems to be not yet working. Tried to setup webhooks with BitBucket Server but only get a code 400 response {"error":"Failed to transform the webhook: Content-Type is not supported: application/json; charset=UTF-8"}
Please make sure that you use the Bitbucket Server specific webhook endpoint, as Bitbucket Server has a completely different webhook format compared to bitbucket.org .
For Bitbucket Server you should use the /h/bitbucket-server/BITRISE-APP-SLUG/BITRISE-APP-API-TOKEN format, instead of the /h/bitbucket-v2/BITRISE-APP-SLUG/BITRISE-APP-API-TOKEN which is bitbucket.org specific (simply replace bitbucket-v2 with bitbucket-server).
If you did not push any code yet, just registered the webhook in Bitbucket Server, then it might also be that Bitbucket Server just sent a “ping” webhook, which has once again a different format (see: https://github.com/bitrise-io/bitrise-webhooks/issues/72 ). If you registered the right endpoint (the /h/bitbucket-server one) try to push a code change, that should work!
I already figured this out, together with your support.
Problem was 1., using the wrong url. But unfortunately, when you select BitBucket from the apps -> code -> incoming webhooks dropdown, you get the BitBucket cloud url. It’s a bit confusing as the dropdown lacks a specific BitBucket Server option and also doesn’t say BitBucket.org or cloud or something do differentiate it from the Server.
Thank you for the issue report again, the fix is now released, so you can select Bitbucket Server from the webhook list on the Code tab of the application: