Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to define a generic (push) webhook for a Bitbucket Cloud Team?

Erik December 5, 2019

It is perfectly well documented how to define a webhook for a dedicated Bitbucket Cloud repository in order to trigger a build when someone has pushed to the repo.

My question is whether it is possible to define a generic webhook (once) for a Bitbucket Team that applies to each repository of the team?

Thank you for your input in advance.

Erik

1 answer

1 accepted

0 votes
Answer accepted
Daniil Penkin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 5, 2019

Hello @Erik,

Thanks for reaching out.

There's no way to make an account-wide webhook, like you described, manually.

However, you can create a Connect App that listens to repository webhooks and install it into an account – this will make it receive webhooks for all repositories owned by that account.

Hope this helps. Let me know if you have any questions.

Cheers,
Daniil

Erik December 5, 2019

Hello @Daniil Penkin ,

thank you very much for your quick reply.

I will check the documentation and leave my feedback.

Best regards,

Erik

Erik December 10, 2019

Hello @Daniil Penkin ,

thanks again for your hind. I checked the documentation, but I do not see how a Conncect App could help concerning my question.

But I think the more promising approach could be to automate the process of creating repositories using the Bitbucket Cloud REST API.

There is a resource to create webhooks via API thus it is possible to create a script that would do both create a repository and define a webhook in one go.

Best regards,

Erik

Daniil Penkin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 11, 2019

So you can create an app and define webhooks module in its descriptor — there you can configure which webhooks Bitbucket should send to your app. This may include repository creation, repository push and so on. If you install such app into account, you'll get relevant webhooks for all repositories in that account.

As an example, Code Search and Pipelines are in fact Connect apps installed into your account – this is why you'll see them in the Installed apps list under your Bitbucket settings if you opted in to using them.

Hope this helps.

Cheers,
Daniil

Like Erik likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events