8

当我尝试设置 slack 集成时出现 403 错误和一个挂起的页面,知道是什么原因造成的吗?

这些是网址

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

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

如果其他人非常了解bitbucket,那么还有一个选项可以防止删除repos,当我尝试启用!Forbidden 消息时也会出现。这些是否与我的帐户处于免费级别有关?错误反馈很少。

4

2 回答 2

17

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.

于 2016-01-08T16:13:31.790 回答
1

如前所述您可以使用聊天通知而不是 webhook:

  1. 登录 Bitbucket

  2. 在连接到 Slack 的帐户中打开特定存储库以添加通知。

  3. 单击设置,然后选择聊天通知 > 设置。选择以下选项之一:

    1. 如果您已经将此存储库连接到 Slack,请单击添加订阅。
    2. 如果这是您第一次将存储库连接到 Slack 工作区,请单击连接按钮。
    3. 单击添加订阅,然后选择添加新工作区(如果要添加新订阅)到新工作区。
  4. 选择 Slack 工作区和通道以连接到您的存储库。


您可以通过Chat Notifications > Settings订阅其他存储库,或者输入/bitbucket connect <repository URL>之前已连接到 Bitbucket 的 Slack 工作区。

于 2019-04-08T21:18:09.640 回答