Created
May 19, 2011 14:59
-
-
Save ianbattersby/980950 to your computer and use it in GitHub Desktop.
TFS Subscriber example, need to access WorkItemStore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public EventNotificationStatus ProcessEvent( | |
TeamFoundationRequestContext requestContext, | |
NotificationType notificationType, | |
object notificationEventArgs, | |
out int statusCode, | |
out string statusMessage, | |
out ExceptionPropertyCollection properties | |
) | |
{ | |
statusCode = 0; | |
statusMessage = string.Empty; | |
properties = null; | |
if (notificationType == NotificationType.Notification && notificationEventArgs is WorkItemChangedEvent) | |
{ | |
WorkItemChangedEvent data = notificationEventArgs as WorkItemChangedEvent; | |
// I now have access to the CoreFields and TextFields via WorkItemChangedEvent | |
// but I want to access other fields in the work item. It seems the only way to do | |
// this is to load the WorkItem from the WorkItemStore in full. | |
// Although I can connect to the WorkItemStore using the WorkItemTracking.Client | |
// methods this seems messy, and I'd have to construct the URL from | |
// TeamFoundationRequestContext - SURELY there a way to access the WorkItemStore | |
// using the existing context (TeamFoundationRequestContext)? | |
} | |
return EventNotificationStatus.ActionPermitted; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment