Skip to content

Make Slack notifications use a user's Slack username for a "mention"

Summary

We love Gitlab and Slack. Unfortunately, the integration of the 2 leaves something to be desired when it comes to notifying users.

Here's my attempt at writing the ideal scenario:

Feature:  Slack Notification Highlighting when mentioning a user

  Scenario:
    Given the "Dan" user has set his "Slack" user
    Given the "Infrastructure" project has the Slack integration
    When the "Dan" user comments on an issue in project "Infrastructure" mentioning the "Justin" user
    then the message posted to Slack should translate the Gitlab username to the Slack username
    and the "Justin" user will receive a Slack "mention"

I suppose the key changes in this feature would be as follows:

~"feature proposal"

Our Workaround

  • In order to generate a Slack "mention" for the Gitlab user, justin.awesome.com, who has the Slack username, @justin, I have to write a comment like this:

      <@justin> could you review this please?
    • This works by Slack's message formatting

    • Ideally, I'd be able to write a comment like this:

          @justin.awesome.com could you review this please?
      • And the @justin Slack user would receive a mention in Slack