Configure Slack

Configure Slack to control how P4 Code Review connects to Slack, routes notifications, and formats messages.

Slack configuration is defined per workspace and controls:

  • Workspace connection and authentication.

  • Project-to-channel mappings.

  • Notification settings.

  • @mention behaviour.

  • Message content and formatting.

  • Bot identity settings.

Configure Slack using System Information (recommended)

Open the user menu (top-right corner of P4 Code Review) and select System Information.

  1. Click Configuration.

  2. Open the Slack tab.

  3. Add or edit a Slack workspace.

  4. Configure the required settings for that workspace. To learn more about these settings see, Slack configuration settings

  5. Save your changes.

The configuration stored in System Information is the runtime source of truth. Settings saved in the System Information override values in config.php.

Configure Slack using config.php (legacy)

File-based configuration is supported for backward compatibility but will be phased out in a future release.

To learn more, see Configure Slack (legacy) .

Slack configuration settings

The Slack settings are configured on a workspace-by-workspace basis, allowing you to keep your workspaces separate.

Workspace Details

  • Workspace ID - After you have added a Slack workspace in P4 Code Review, you cannot update the Workspace ID.

  • Bot Token: - Update the Slack bot token used to authenticate API requests. Each configured workspace must have a valid bot token.

Project channels

Map projects to Slack channels to route notifications. You can:

  • Map projects to specific Slack channels.

  • Map a project to multiple Slack channels.

  • Use *all* as the default channel when no project-specific mapping exists.

To set up Project-Channel mapping:

  1. Click + Add Project Channel.

  2. In Project, enter either:

    • The ID Project to map to the channel.

    • *all* - To send notifications for every project to the selected channel

    • *no_project_channel* or *without_project* to route notifications that are not associated with a project.

  3. In Channels, enter the Slack channels to send the project notifications to.

Notification settings

Control how notifications are delivered.

  • Summary File Names - Turn on to include file names in the review summary posted to Slack.

  • Reply File Names - Turn on to include file names in reply notifications. To learn more about message content and file displays, see Slack message content and previews

  • Bypass Restricted Changelist - Turn on to allow Slack notifications for restricted changelists. This setting applies independently to each workspace.

  • Notify Mentioned Only - Turn on notify only the users who are explicitly mentioned in a review.

  • Notify - This lists the user groups that receive review event notifications. Click on the user group to enable or disable the notifications:

    • If a group name is in Blue, they will receive notifications

    • If a group name is in White, they will not receive notifications

    For detailed behaviour and examples, see Notification behavior and mentions.

  • Summary File Limit - Set the maximum number of files to list in the Slack review summary. By default, this is 10.

Custom Bot User settings

Enable a custom Slack username and avatar for notifications instead of using the default bot identity.

To use a custom bot user:

  1. Custom Bot User - Turn this on to use a custom bot user.

  2. Bot Display Name - Enter a name for the Custom Bot. This is displayed in Slack when the bot posts a notification.

  3. Bot Avatar URL - If you want the bot to have a profile photo, enter a URL of the image used as the bot's profile photo (avatar).

  4. Force User Header - Display the user name and avatar on every notification, even when Slack groups consecutive messages from the same sender.

These settings affect the appearance of Slack notifications but do not change notification behaviour. To learn more about how messages appear in Slack, see Slack message content and previews.