Skip to content

Mentions Extension ​

With Mentions, you can effortlessly tag specific users or groups in Slack, Teams, or Google Chat messages whenever a test fails. This ensures that the right people are promptly notified, improving response times and collaboration. Additionally, Mentions can automatically tag users based on your on-call rotation schedule, streamlining your workflow and ensuring that the appropriate team members are always in the loop.

Mentions Example

TIP

In general, tagging users will help to maintain accountability on owning test failures. It also reduces the ambiguity on who needs to look into failures based on a on-call schedule.

Configuration ​

Basic Syntax ​

json
{
  "name": "mentions",
  "inputs": {
    "users": [
      {
        "name": "Jon",
        "teams_upn": "[email protected]"
      }
    ]
  }
}

Parameters ​

  • users (object[]) - List of users to mention
    • name (string) - Name of the user to display
    • teams_upn (string) - User's UPN in Teams (required for Teams)
    • slack_uid (string) - User's unique ID in Slack (required for Slack)
    • slack_gid (string) - User group's unique ID in Slack
    • chat_uid (string) - User's unique ID in Google Chat (required for Chat)
    • enable (boolean) - Enable or disable user's availability for on-call support
  • schedule (object) - On-call schedule configuration
    • layers (object[]) - On-call schedule layers
      • start (string) - Start time in format HH:MM:SS
      • end (string) - End time in format HH:MM:SS
      • user (object) - Single user for this layer
      • rotation (object) - Rotation configuration for multiple users
        • every (string) - Rotation schedule: day or week
        • users (object[]) - Users in rotation

Default Behavior ​

  • Hook: end
  • Condition: fail

Examples ​

Basic User Mention ​

Mention a specific user when tests fail:

json
{
  "targets": [
    {
      "name": "teams",
      "inputs": {
        "url": "{TEAMS_WEBHOOK_URL}"
      },
      "extensions": [
        {
          "name": "mentions",
          "inputs": {
            "users": [
              {
                "name": "Jon",
                "teams_upn": "[email protected]"
              }
            ]
          }
        }
      ]
    }
  ]
}

Slack User Group Mention ​

Mention a user group in Slack:

json
{
  "name": "mentions",
  "inputs": {
    "users": [
      {
        "name": "team-awesome",
        "slack_gid": "S0123456789"
      }
    ]
  }
}

Special Slack Mentions ​

Mention special groups like @here, @channel, or @everyone:

json
{
  "name": "mentions",
  "inputs": {
    "users": [
      {
        "name": "here",
        "slack_gid": "here"
      },
      {
        "name": "channel",
        "slack_gid": "channel"
      },
      {
        "name": "everyone",
        "slack_gid": "everyone"
      }
    ]
  }
}

Weekly Rotation ​

Rotate mentions based on week number:

json
{
  "name": "mentions",
  "inputs": {
    "users": [
      {
        "name": "Alice",
        "slack_uid": "U0123456789"
      },
      {
        "name": "Bob",
        "slack_uid": "U9876543210"
      }
    ],
    "schedule": {
      "layers": [
        {
          "rotation": {
            "every": "week",
            "users": [
              {
                "name": "Alice",
                "slack_uid": "U0123456789"
              },
              {
                "name": "Bob",
                "slack_uid": "U9876543210"
              }
            ]
          }
        }
      ]
    }
  }
}

Time-Based Layers ​

Different users for different time periods:

json
{
  "name": "mentions",
  "inputs": {
    "schedule": {
      "layers": [
        {
          "start": "09:00:00",
          "end": "17:00:00",
          "user": {
            "name": "Day Team Lead",
            "slack_uid": "U1111111111"
          }
        },
        {
          "start": "17:00:00",
          "end": "09:00:00",
          "user": {
            "name": "Night Team Lead",
            "slack_uid": "U2222222222"
          }
        }
      ]
    }
  }
}

Multi-Platform Configuration ​

Configure mentions for multiple platforms:

json
{
  "targets": [
    {
      "name": "slack",
      "inputs": {
        "url": "{SLACK_WEBHOOK_URL}"
      },
      "extensions": [
        {
          "name": "mentions",
          "inputs": {
            "users": [
              {
                "name": "DevOps Team",
                "slack_gid": "S0123456789"
              }
            ]
          }
        }
      ]
    },
    {
      "name": "teams",
      "inputs": {
        "url": "{TEAMS_WEBHOOK_URL}"
      },
      "extensions": [
        {
          "name": "mentions",
          "inputs": {
            "users": [
              {
                "name": "DevOps Team",
                "teams_upn": "[email protected]"
              }
            ]
          }
        }
      ]
    }
  ]
}

Platform-Specific Output ​

Slack ​

Slack Mentions

  • Individual users: @username
  • User groups: @team-name
  • Special mentions: @here, @channel, @everyone

Microsoft Teams ​

Teams Mentions

  • Users mentioned by UPN with Teams-style notifications
  • Proper Teams mention formatting and notifications

Google Chat ​

  • Users mentioned by unique ID with Chat-style notifications

Finding User IDs ​

Slack User ID ​

  1. Via Slack App:

    • Right-click on user → View profile
    • Click "More" → Copy member ID
  2. Via API:

    bash
    curl -H "Authorization: Bearer your-token" \
         "https://slack.com/api/users.list"

Slack Group ID ​

  1. Via Slack App:

    • Go to usergroup settings
    • Copy the ID from the URL
  2. Via API:

    bash
    curl -H "Authorization: Bearer your-token" \
         "https://slack.com/api/usergroups.list"

Teams UPN ​

The UPN is typically the user's email address in your organization.

Google Chat User ID ​

  1. Via Google Admin Console:
    • Users → Select user → User information
    • Copy the unique ID

Best Practices ​

On-Call Management ​

  • Use rotation schedules to distribute responsibility
  • Enable/disable users based on availability
  • Layer different time zones for global coverage
  • Test your schedule before deploying to production

Notification Strategy ​

  • Mention specific users for critical failures
  • Use groups for general awareness
  • Avoid @everyone except for critical system-wide issues
  • Consider time zones when setting up schedules

Multi-Platform Consistency ​

  • Keep user lists synchronized across platforms
  • Use consistent naming for users across Teams/Slack
  • Test mentions on all configured platforms
  • Document your mention strategy for the team

Troubleshooting ​

Common Issues ​

  1. User not mentioned:

    • Verify user ID is correct
    • Check if user is enabled
    • Confirm user is in the workspace
  2. Schedule not working:

    • Verify time format (HH:MM:SS)
    • Check timezone settings
    • Ensure rotation users are properly configured
  3. Group mentions not working:

    • Verify group ID is correct
    • Check group permissions
    • Ensure bot has permission to mention groups

Released under the MIT License.