TFS comes with a tool called bissubscribe.exe, typically installed at “C:\Program Files\Microsoft Visual Studio 2005 Team Foundation Server\TF Setup”. Bissubscribe is a command-line tool that adds subscribers to the TFS notification database (tbl_Subscriptions).
Note: it might be tempting to configure subscriptions directly in the database but currently changes made to the table won’t be reflected until the TFS service is restarted. So to avoid additional headache just use BisSubscribe or the TFS API to manage subscriptions.
The tool can be used for setting up email notifications as well as notifications to a generic web service for application level integration.
The following commands are available in BisSubscribe:
BisSubscribe - Team Foundation Server BisSubscribe Tool
(C) Copyright 2006 Microsoft Corporation. All rights reserved.
BisSubscribe /eventType <eventType> /address <emailOrSoapAddress> [/deliveryType EmailHtml|EmailPlaintext|Soap] [/server <servername>] [/filter <filterString>] [/tag <tag>]
BisSubscribe /unsubscribe /id <id> [/server <servername>]
eventType: The name of the event. Case sensitive.
filter: (default none) A filter expression.
address: The email address or webmethod URL for the subscriber.
server: The Team Foundation Server name.
tag: (default none) A field to later use to identify this subscription.
deliveryType: (default Soap) EmailHtml|EmailPlaintext|Soap indicating the preferred format.
id: The integer id for the subscription to be deleted when unsubscribing.
The two parameters that I think requires some extra explanation are:
· eventType: type of event to subscribe to. See this post of a list of events and how to work with them.
Note: the tool is case-sensitive, so make sure to spell the event type correctly.
· filter: a filter expression applied to the data passed for the generated event.
The TFS SDK on MSDN has a section on how to use filters. See Filtering Team Foundation Server Events http://msdn2.microsoft.com/en-us/library/bb130302(VS.80).aspx for more details.
So for example to register an email notification based on the check-in event we issue the following command:
BisSubscribe.exe /eventType CheckinEvent /address mathias@win2003 /deliveryType EmailHtml