It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

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

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

Hello @Daniil Penkin ,

thank you very much for your quick reply.

I will check the documentation and leave my feedback.

Best regards,

Erik

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

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
Community showcase
Posted in Bitbucket

Contest: Share your custom Bitbucket Pipe and win

Announced in this blog, this holiday season we’re celebrating all things CI/CD and between now and the end of 2019 we’ll be showcasing content, use cases, feature announcements and more. One featur...

751 views 2 4
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you