TeamCity 2020.2 Help

Notifications

The Notifications build feature is responsible for sending notifications about build statuses and events to external services. Currently, the feature provides Email Notifier and Slack Notifier.

This feature adds to the functionality of user-level notifications that can be assigned to a particular user or user group, but it allows configuring notifications per build configuration. This approach does not require referencing a specific TeamCity user and works better for group notifications.

Email Notifier

To configure email notifications for a build configuration:

  1. Enter the target email. For example, you can specify an email list address, and all its subscribers will be receiving build notifications automatically.

  2. Configure a branch filter. If it is not configured, you will receive notifications about the default branch only.

  3. Select events to watch.

Note that TeamCity Email Notifier relies on the SMTP server settings configured in Administration | Server Administration.

Slack Notifier

The Slack Notifier feature relies on a Slack connection that should be preconfigured in the parent project's settings.

Configuring Slack Connection

The TeamCity integration with Slack requires creating a Slack app with the following bot token scopes: channels:read, chat:write, im:read, im:write, users:read, team:read, groups:read. You can add these in Features | OAuth & Permissions | Scopes of your Slack app.

To ensure your TeamCity server can connect to Slack, specify all the possible endpoint addresses of the server as Redirect URLs in Features | OAuth & Permissions. In most cases, it would be enough to specify the Server URL set in Global Settings in TeamCity. However, if you use a proxy for your TeamCity server but access this server directly, the authentication in Slack might not work unless the server's IP address is also specified in Redirect URLs.

Now you can return to TeamCity and configure a connection to Slack. Go to Project Settings | Connections and click Add Connection. In the opened form, select the Slack type and give a connection any convenient name.

Enter the app parameters:

  • Client ID and Secret from the app's Basic Information page

  • a bot user token of your app

Save the connection and proceed with adding the Notifier feature.

Configuring Slack Notifier

After configuring the connection, go to the settings of the build configuration you want to receive notifications for:

  1. In Build Features, add the Notifications feature and select Slack Notifier.

  2. Choose the created connection.

  3. Enter the ID of a channel or user who will be receiving notifications.

  4. Select the message format. Slack Notifier does not currently support custom notification templates. However, if you select the verbose format, you will be able to choose what information to display in notifications.

  5. Configure a branch filter. If it is not configured, you will receive notifications about the default branch only.

  6. Select events to watch.

Last modified: 05 March 2021