Hamed
Hamed

Reputation: 501

Trigger bamboo plan from bitbucket Webhooks

I spent a couple of hours to figure out why I'm not able to trigger a webhook from bitbucket to bamboo, I found nothing yet

Issue: I want to track when a PR is merged or a branch is deleted which as I see I'm not able to track this stuff from bamboo, so I need to have a webhook in bitbucket and call a bamboo reset api base on this page if there is no better idea.

base on this page I thought I can trigger a webhook https://confluence.atlassian.com/bamboo/triggering-a-bamboo-build-from-bitbucket-cloud-using-webhooks-873949130.html

But this solution is now working because each time I got this error message

{"message":"Anonymous user can't access this resource. If it should be available, modify anonymous user permissions at Administration > Security settings","status-code":401}

The only access we have for Anonymous group is view which I see this is not enough to call this API from bitbucket https://confluence.atlassian.com/bamboo/bamboo-permissions-369296034.html

So I don't know what to do and how to track if a PR is merged or a branch is deleted.

I would appreciate to tell me what the problem is

FYI: bamboo and bitbucket version is the latest one

Upvotes: 3

Views: 2063

Answers (2)

Anuradha Fernando
Anuradha Fernando

Reputation: 1157

The easiest way is to enable triggers for anonymous users. Also, as @Hamed mentioned, allowing anonymous access is not feasible in some environments. The problem is we cannot even go with <User>:<Password>@<Bamboo URL> and that strips off the auth details.

One possible way of doing this is to keep a proxy between Bitbucket and Bamboo and then add the Authentication headers at the proxy level.

Upvotes: 0

Oleksiy Chystoprudov
Oleksiy Chystoprudov

Reputation: 1145

What is your Bamboo version? This issue was covered at Bamboo 6.7.0. At Bamboo > Administration > Security settings you can grant/deny access of anonymous users to given webhook

Upvotes: 1

Related Questions