Team System has a built-in, extendable alerting mechanism. It is based on SQL Server 2005 Notification Services. Microsoft SQL Server Notification Services is a platform for developing and deploying applications that generate and send notifications to subscribers.
This walkthrough will help you understand the notification mechanism and provide you the knowledge needed to apply them.
Events on Team System
TFS can process the following predefined events:
Raised when an access control list has been changed
Raised when a branch has been moved
Raised when team build has been completed
Raised when a team build status has been changed
Raised when a check in operation has been occurred
Raised when a data has been changed
Raised when an identity has been changed
Raised when an identity has been created
Raised when an identity has been deleted
Raised when a group membership has been changed
Raised when a work item data has been changed
Each event is passing xml data as a parameter to its subscribers. The schema of xml parameters differs from one event to another.
You can find type definitions for TFS events parameters in this folder:
[C:]\Program Files\Microsoft Visual Studio 2005 Team Foundation Server\Web Services\Services\v1.0\Transforms
Notifications can be delivered either in the form of an email notification or of a SOAP Endpoint (a Web Service).
Query your current subscriptions
Query: SELECT * FROM tbl_subscription
Web service listener implementation:
Each web contains one method called "Notify". The method accepts one parameter eventXml that contains the event data based on the event's schema.
To implement the web service, use the following signature:
[SoapDocumentMethod(Action = "http://schemas.microsoft.com/TeamFoundation/2005/06/Services/Notification/03/Notify", RequestNamespace = "http://schemas.microsoft.com/TeamFoundation/2005/06/Services/Notification/03")]
public void Notify(string eventXml)
Enter your code here…
You can download TFS Notification Web Service project template from here
Subscription tool for notifications
To subscribe to one of the events, you should use the BisSubscribe.exe tool.
You can find it at: [C]:\Program Files\Microsoft Visual Studio 2005 Team Foundation Server\TF Setup
BisSubscribe /eventType /address [/deliveryType EmailHtml|EmailPlaintext|Soap] [/server ] [/filter ] [/tag ]
BisSubscribe /unsubscribe /id [/server ]
eventType: The name of the event. (Case sensitive)
filter: A filter expression. default = none
address: The email address or webmethod URL for the subscriber.
server: The Team Foundation Server name.
tag: A field to later use to identify this subscription. default = none deliveryType: EmailHtml|EmailPlaintext|Soap indicating the preferred format. default = Soap
id: The integer id for the subscription to be deleted when unsubscribing.
You can also check out open source TFS Even Subscriber GUI utility
Another way to subscribe is through the API. See this post.
(Thanks to Naren)
Check email address validity