Team Foundation Server offers some extensibility through event notifications these can either be in the form of an email notification or a SOAP Endpoint. To register a notification subscription you have to use the BisSubscribe.exe tool (see http://blogs.msdn.com/psheill/archive/2006/02/01/522386.aspx for more information) - which allows you to register an email address (to which an email will be sent with the event details as long as you supply the appropriate email template to convert the serialized event) or a SOAP Endpoint which will be called when the event is raised.
Scrum for Team System uses event notification to calculate work remaining at the Product Backlog level (it aggregates all child Sprint Backlog Items’ Work Remaining field) – while developing this functionality I thought it would be good to develop a template that other people could utilize for their own modifications to Team Foundation Server. It wasn’t until I stumbled across the MSDN Magazine article “Create Reusable Project And Item Templates For Your Development Team” that I found a decent mechanism for packaging and distributing this project.
This version of "TFS Notification Web Services" supports the following events:
- AclChangedEvent
- Branchmovedevent
- BuildCompletionEvent
- BuildStatusChangeEvent
- CommonStructureChangedEvent
- DataChangedEvent
- IdentityChangedEvent
- IdentityCreatedEvent
- IdentityDeletedEvent
- MembershipChangedEvent
- WorkItemChangedEvent
This Visual Studio 2005 Project Template will create a SOAP Endpoint for each of the above events. Each service has one method by default; called "Notify" this accepts two parameters - a serialized version of the event and a serialized version of the identity of the Team Foundation Server which raised the event. For ease of use I have generated types for the events and have added basic deserialization code to convert the raw XML to the type so you can perform analysis directly on them.
For example:
public void Notify(string eventXml, string tfsIdentityXml)
{
AclChangedEvent aclChangedEvent = this.CreateInstance<AclChangedEvent>(eventXml);
TFSIdentity tfsIdentity = this.CreateInstance<TFSIdentity>(tfsIdentityXml);
}
To install the template, download the zip from my projectDistributor workspace, extract and copy the "TFS Notification Web Services.zip" file to the directory "X:\Documents and Settings\YOUR_USER_NAME\My Documents\Visual Studio 2005\Templates\ProjectTemplates" and then open Visual Studio 2005 and select File > New Web Site. From the "My Templates" section and then select "TFS Notification Web Services"