Slack with Visual Studio Team Services

Last Update: 4/28/2017

Post messages to Slack in response to events in your Visual Studio Team Services account, like completed builds, code changes, and new and updated work items.

Create the Slack integration

  1. From any page on your team's Slack (https://[team].slack.com/...), click your account name in the left window pane to open up the menu, and find Apps and integrations: Integrations link on the account home page

  2. Search for and click the Visual Studio Team Services integration: Visual Studio Team Services link

  3. On the Visual Studio Team Services integration page, click Install.

  4. Choose a channel to have notifications posted to from the dropdown and click Add Visual Studio Integration.
  5. Scroll down the page and copy the web hook URL to use when you create the service hook subscription in your Visual Studio Team Services account. Web hook URL in the integration settings section

Create a service hook subscription in your Visual Studio Team Services account

  1. From your Visual Studio Team Services account's team project page (https://[account].visualstudio.com/[project]), navigate to Service Hooks in the settings: Team Services Service Hook Settings

  2. Click Create subscription and select the Slack service.

  3. Choose the types of events you want to appear in your Slack channel.

    You can filter each of the triggers in specific ways. For example, the pull request created trigger can be filtered on the repository in which the pull request occurs, the target branch it applies to, and the team members that are required or invited to review the request.

  4. Paste the web hook URL from the Slack integration that you created and click Finish. Action dialog box with the web hook URL

  5. Now, when the event you configured happens in your project, a notification will apear in your team's Slack channel. General channel with a real pull request notification

Pricing

Visual Studio Team Services doesn't charge for the framework for integrating with external services. Check out the specific service's site for pricing related to their services.

Q & A

Q: Why don't I have the pull request events as an option when I configure my trigger?

A: Pull requests are only available with team projects that use Git. If your team project uses TFVC, pull event triggers aren't available, and your code event is called "Code checked in" instead of "Code pushed".

Q: How can I get multiple events to show up in my Slack channel?

A: Create a new subscription for each type of event you want. For example, if you want to see build failures and new work items in your Slack channel, create two additional subscriptions.