A better way of integrating TeamCity with Slack.com using WebHooks

Posted on Updated on

I wrote a blog post in 2014 about how it’s possible to get tcWebHooks to send messages to slack. It turned out to be one of the more popular posts.

The good news is that in version 1.1 of tcWebHooks, it got whole lot easier.

TL;DR

  1. Install the latest tcWebHooks 1.1 (or higher) plugin into TeamCity.
  2. Create an incoming webhook in slack.
  3. Create a webhook in TeamCity and choose from one of the Slack payload formats
  4. That’s it!

 

Bundled Slack WebHook Templates

As of the time of writing (December 2017), there are two Slack specific webhook templates bundled with a tcWebHooks release.

1. The “Slack.com JSON templates” payload format has templates which produce a message in slack with some information about the build.

33641251-a070628e-da99-11e7-8060-a454b535d52a

2. The “Slack.com Compact Notification” has templates which produce a more compact notification.

33641310-da06b0c0-da99-11e7-9d2f-f8a30ecb6364

If neither of those are right for you, it’s possible to create your own template by either copying an existing one, or creating a new one.

WebHook Templates

A WebHook Template is a predefined payload that can be reused with multiple webhook configurations. I’ve prepared a few to get you started, but it’s very easy to modify them or create your own. The ones bundled with tcWebHooks include:

Creating or editing templates is accomplished using a WebUI built on top of the tcWebHooks REST API.  Further information about WebHook Templates is on the wiki.

 

Advertisements

2 thoughts on “A better way of integrating TeamCity with Slack.com using WebHooks

    […] Update: Since version 1.1 of tcWebHooks, this  is now much simpler. See A better way of integrating TeamCity with Slack.com using WebHooks […]

    Brett W Green said:
    February 23, 2018 at 13:29

    Very helpful… I have tried all of the slack plugins and don’t like any of them. Will try to switch to using this approach. Thanks!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s