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

Bitbucket-Slack webhook integration problem

Kliment January 11, 2019

TODO:  receive only specific notification(on commit only) from Bitbucket at specific Slack channel 

What I did: 

  • Created a new pp at Slack 
  • connect the App to Slack channel
  • got a webhook from the App
  • at bitbucket opened my repo, selected “Settings” in left navigation
  • “Workflow” section, click “Add webhook” button
  • Gave the webhook a unique name and paste in the hook generated by Slack as described above

No matter what triggers I tried to use (push only) or choose from list - nothing is happening when I make a commit

But, if I simply use Slack webhook together with curl -X POST -H ..... - I successfully get my messages in desired Slack channel.

What should I to make this work?

1 answer

1 accepted

1 vote
Answer accepted
Stephen Sifers
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 15, 2019

Hello Kliment and welcome to the Community!

Connecting Bitbucket to slack should not require a webhook, the application should prompt for the Slack channel and then configure the application. You chat settings  within Bitbucket should look as follows:

 image.png

The older webhook method should be removed when configuring the new method:

If your repository uses the prior Slack integration

If your repository is already set up to trigger notifications for Slack, we recommend that you deconfigure the integration to avoid duplicate notifications. You can stop these notifications from either Bitbucket or Slack.

  1. From Bitbucket, remove the repository's Slack webhooks:
  2. From your repository's Settings, click Webhooks.

Click Delete for the webhooks configured for Slack.

  1. From Slack, remove the Bitbucket app:
  2. From the Slack App Directory, click Manage.

Find the Bitbucket app (with the old logo) and remove the app.

Source document: Bitbucket Cloud for Slack

Using the new application method should allow you to integrate Bitbucket with Slack without the need for webhooks.

If you’re still having issues with the integration, please let us know.

Regards,
Stephen Sifers

Kliment January 26, 2019 edited

Hello Stephen!
Thanks for your help and I'm glad to be a part of the community!
Your advice was helpful, but I need to specify some things.

I've got genuine Bitbucket and Jira bots running at my Slack workspace. They doing their job fine, however I do receive duplicate notifications from the bots themselves and to #general channel as well.

You suggest to remove the Bitbucket app. Does it mean that Atlassian's Bitbucket app doesn't need anymore and I'll be able to receive notifications just by setting up Chat notifications in my repositories' Settings?

And does the same method can be applied to Jira bot and notifications too?

Stephen Sifers
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 28, 2019 edited

Hello Kliment,

Any Bitbucket webhook connections which are in place between Slack and Bitbucket should be removed and replaced with the new Bitbucket App. With this said, if you’re getting duplicate messages from Bitbucket to Slack via the app then we may have another issue present.

Can you please clarify if the duplicates are from a webhook or the Bitbucket app?

Regards,
Stephen Sifers

arturmamedov
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 16, 2020 edited

Previously it worked well also with Webhook's, so now the new way is to use the Bitbucket Cloud App?

julija.damjanovic
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 18, 2020

I do not manage to find a Chat Notification option in my Repository settings. I have tried all the other ways of Slack integration without success.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Upcoming Bitbucket Events