2

I'm trying to integrate sonarcloud (not sonarqube) with a Slack channel. I want to have the same behaviour in Slack that the one we have in Github or Travis integration: I mean a push notification on a channel.

In Slack exists the option of a webhook but it's limited because only accepts an input format:

{
    "text": "message"
}

On the other side, on sonarcloud, there is the possibility to send a POST message to a webhook, but doesn't exist the chance to choose the format of the message, because it's predefined. Has someone any idea about how to connect these two services?

I have thought to use a AWS lambda in order to adapt the message as a bridge but i'm looking for simpler ideas which do not require more infrastructure.

Pau Trepat
  • 697
  • 1
  • 6
  • 24

2 Answers2

0

I've used email notifications from sonar cloud and added Zapier "Gmail-Slack" integration for emails with a specific filter. A bit hacky but it works well.

oborovyk
  • 385
  • 2
  • 9
-2

A little late, but for people who might be looking for the answer on this one. I didn't integrate SonarCloud with Slack (yet), but I've had success integrating both CircleCI and SonarCloud with GeckoBoard using zapier which is an online service. It can accept a webhook and then allows you to connect it to a different service (ie, Geckoboard or Slack) by selecting and modifying values in that webhook before sending it on in the correct format. Quite easy to do as well; no programming and no servers to maintain. Hope this helps.

evdh
  • 229
  • 2
  • 7
  • Please add some code so other users can test what you're describing. Thanks! – Ignacio Ara May 14 '18 at 10:31
  • There is no code involved; it describes how to link any application that supports webhooks (ie, sonarcloud) to other applications that can be called by an api (ie, slack) by configuring an online integration service (zapier). I can't describe all the steps, but just to let people know that this is possible if you want to put in some time and you do not have to run any servers yourself. As an indication, configuration of Zapier to connect sonarcloud to geckoboard took about an hour, and then another hour to tidy it up (ie, show the date in a nicer format and show 'success' and 'failed' images). – evdh May 15 '18 at 13:10
  • 1
    Question specifically asked for Slack, not GeckoBoard – Paul Carroll May 17 '23 at 22:43