When playing around with this Interface you will notice that it is very easy to subscribe and unsubscribe to events via the TFS Object Model.The method signature for Subscribing to an event is:
int SubscribeEvent (
string userID,
string eventType,
string filterExpression,
DeliveryPreference preferences
)
As you can note there is several string values that are needed to pass in. I found no documentation on what eventTypes or Filter expressions were available. Hopefully the following information will help you as you develop with the Object Model.
UserID: simple enough.
eventType: Out of the Box
To view event types on a certain TFS server you can consume http://ServerName:8080/Services/v1.0/Registration.asmx to enumerate through the listor, you can use the IRegistration interface and loop through each RegistrationEntry for each EventType.
Filter Expression:
Example expression:
Condition String = "PortfolioProject" = 'Project Name' AND ("CoreFields/StringFields/Field[ReferenceName='System.AssignedTo']/OldValue" = 'Ed Kisinger' OR "CoreFields/StringFields/Field[ReferenceName='System.AssignedTo']/NewValue" = 'Ed Kisinger') AND "CoreFields/StringFields/Field[ReferenceName='System.AuthorizedAs']/NewValue" <> 'Ed Kisinger'
Ed K.
Page rendered at Friday, December 05, 2008 4:07:54 AM (Central Standard Time, UTC-06:00)
Disclaimer The opinions expressed herein are our own personal opinions and do not represent our employer's view in any way.