TeamCity offers built-in integration with Slack. For example, the integration allows you to send Slack messages whenever a build starts, finishes, or fails.
In this tutorial, we’ll show you how to set up Slack integration in your TeamCity account.
To start, open up your build configuration and click on Edit configuration, then go to the Build Features section.
Click on Add build feature and scroll down to the Notifications build feature. In addition to Slack, the Notifications build feature can also send out email notifications to users.
After that, you’ll have to fill in some details and establish a connection between your TeamCity server and Slack. To do so, you’ll first need to click on the Parent project’s settings link.
On the Slack side, you need to create an application with the specific rights that you can see in this window.
You can then open your application homepage in Slack and scroll down. You’ll find the app credentials at the bottom.
You’ll then need to copy the Client ID and Client Secret as well as Bot User OAuth Token into TeamCity.
You can then test the connection. Slack will ask you what information exactly TeamCity should be able to access. Once you click Allow, the connection will be established. You can then click Save.
Once you’ve established the connection with Slack, you can then choose the channel or person that you want to send Slack notifications to.
You can also change the message format from Simple to Verbose and add more options, such as status text, branch name, and changes.
TeamCity also allows you to add a branch filter if you’d like to get messages related only to a specific branch. You can also choose exactly which events should trigger a notification. For example, you might want to be notified about whether a build failed or succeeded, or when a build fails to start.
Once you’ve selected the options that you like, click Save. You will now start receiving notifications when the conditions are met.
That’s it! Check out our other tutorials to learn how to send build information to GitHub or integrate TeamCity with Jira.
Integrate TeamCity and JIRA for a smoother and shorter feedback loop between your issues, commits, and CI/CD jobs.
There are multiple ways to integrate TeamCity and GitHub. In this tutorial, we go over three most important use cases.
See how using the Commit Status Publisher build feature in TeamCity can help you report your TeamCity build results back to GitHub.