Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Slack Bitbucket Integration

I get 403 errors and a hanging page when i try to set up slack integrations, any idea what causes this?

These are the URL's

GET bitbucket.org/api/2.0/repositories/MyAccount/repo-name/hooks/?pagelen=100

POST bitbucket.org/api/2.0/repositories/MyAccount/repo-name/hooks/

If anyone else knows bitbucket well there is also the option to prevent deletion of repos which when i try to enable a !Forbidden message also appears. Are these related to my account being on the free tier? There is very little error feedback.

like image 964
Iain Watt Avatar asked Dec 10 '15 08:12

Iain Watt


People also ask

How do I integrate into Slack?

From an app's page, click the Add to Slack button. Then follow the prompts to install the app or connect your account. You'll see the option to connect your account after clicking Add to Slack if an app has already been installed in your workspace. You can also find and install apps from your workspace.

How do I access my bitbucket repository settings?

To get to your Bitbucket settings, click your avatar in the lower-left corner and select Bitbucket settings.

How do I find my bitbucket remote URL?

Run git remote -v to see the current remote URL. Update the remote URL with git remote set-url using the current and new remote URLs.


1 Answers

edit

From Atlassian's Bitbucket Cloud for Slack how-to:

(Requires repo admin permissions)

  1. Log into Bitbucket
  2. Open a specific repository to add notifications to, in the account that is connected to Slack.
  3. Click Settings then select Chat notifications > Settings.
  4. Choose one of the following:

    • Click Add subscription, if you've already connected this repository to Slack.
    • Click the connect button, if this the first time your
      connecting a repository to your Slack workspace.
    • Click Add subscription and then select Add new workspace, if you’re adding a new subscription, to a new workspace.
  5. Choose the Slack workspace and channel to connect to your repository.

/edit


Not sure how you're trying to do it, but here is how I got mine to work:

  1. Make sure you have the Bitbucket app installed on Slack. It should show up on your yourteam.slack.com/apps/manage page. In case it doesn't, search Bitbucket on the app directory

  2. Once in the Bitbucket app page on Slack, go to its configuration page (or create a new configuration). Decide to which channel or user should Bitbucket notifications be posted.

  3. On the same page, find the Webhook URL. It looks something like https://hooks.slack.com/services/LONGST/RINGOF/RANDOMChAraCTeRS

  4. On your Bitbucket repository page, click Settings/Webhooks.

  5. Use the Slack URL to create a new Webhook. Assign a unique name to it. I believe Slack only supports Repository Push type of trigger.

I hope it works for you.

like image 62
Thiago Gouvea Avatar answered Oct 19 '22 05:10

Thiago Gouvea