Search code examples
gitlabintegrationwebhooksslack

Notify Gitlab actions in multiple Slack channels using Slack Webhooks


I have two Slack channels - A and B. I've already integrated my GitLab project with channel A (it successfully sends messages about new pushed tags). Now, I want to get messages about new Merge Requests from the same GitLab project to channel B. As I can see, I can't do it for a couple of reasons:

  1. I can use one Slack's Integration App only with one channel at the same time - https://take.ms/2PFKt
  2. I can set different channels for different events in Gitlab - https://take.ms/0xhlE, but it won't work, because I can't add multiple Slack's hooks in the same GitLab project (and as I say above I can't add the same Integration App in a few channels too)

Is it possible to solve this problem?


Solution

  • One Slack hook can send to different channels.

    See: Slack API Doc You can specify channel name

    Solution: Set one Slack hook, then set different channel names for different events.