Hey :)
I'm writing a python script that creates and configures the bitbucket repositories in a certain workspace for my team, using the Bitbucket Cloud API.
Part of our configuration is adding some slack notifications, and until now we configured it like you mentioned in your documentation here https://support.atlassian.com/bitbucket-cloud/docs/integrate-bitbucket-cloud-with-slack/
To my understanding (fix me if i'm wrong) this configuration is different than the traditional webhook configuration, as written in the above link and as seen in the UI, but it seems like the API does not support it (used this API doc)
My team and I would like to get some guidance for how to handle this, assuming we don't want to continue creating the integration manually; should we use the API and add slack as a webhook? will this method be out of support sometime?
Thanks in advance!
Hi Noa,
Can you please clarify the exact behaviour you are trying to achieve? Are you trying to use the API to trigger a slack notification?
The recommended method for integrating Slack notifications is via the documentation you've provided.
Cheers!
- Ben (Bitbucket Cloud Support)
Hey, Thank you for your answer!
To clarify, I'm not looking to directly trigger a Slack notification using the API.
Instead, using the API, I want to configure my repository to send Slack notifications for certain events, such as when a pull request is created.
The only way I saw possible for doing so is using webhook related API calls, for example:
curl --location 'https://api.bitbucket.org/2.0/repositories/<workspace>/<repo slug>/hooks' --header ....
But then this is the outcome:
While in the documentation it's a completely different settings section and configuration process:
The behavior I would like to achieve is to configure using the API what you call a slack integration (the picture above), and not a webhook directing to slack.
Is that possible? and if not, do you suggest creating a webhook for every repository (assuming we want it automatic)?
Have a pleasant day!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Noa,
Unfortunately, you are not able to configure a Slack integration over API which would not just be a regular webhook.
Refer to this documentation to install the Slack integration, this will allow you to configure which events would trigger a Slack notification:
Essentially you would go to Repository Settings > Slack and then click the Add Subscription button on this screen.
This integration is still a webhook, but does not require manual setup like you would with configuring other webhooks.
Please let me know if further clarification is needed.
Cheers!
- Ben (Bitbucket Cloud Support)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
ScriptRunner Connect has a template that integrates Bitbucket with Slack, not exactly the use case you need, but you may get some clues from that code.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.