Hi folks. We have a custom TFS plugin (written in C#) that we use to subscribe to work item changes.
We are in the process of upgrading to TFS 2013, so we are upgrading the plugin.
Unfortunately, the new version plugin does not respond to WorkItemChangedEvents. It responded to these without issue in TFS 2012.
Is there a flag somewhere in the TFS configuration to disable these events that we might have set? The plugin will pick up other event types, so I'm not sure if the plugin is the problem.
I've been using a very simple plugin to test if the events are raised. The C# code for this is below:
using Microsoft.TeamFoundation.Common; using Microsoft.TeamFoundation.Framework.Server; using Microsoft.TeamFoundation.Server.Core; using Microsoft.TeamFoundation.WorkItemTracking.Server; using System; using System.Configuration; using System.Diagnostics; namespace TestSubscriber { class TestSubscriber : ISubscriber { #region ISubscriber Members public string Name { get { return "TestSubscriber"; } } public SubscriberPriority Priority { get { return SubscriberPriority.Normal; } } public Type[] SubscribedTypes() { return new Type[3] { typeof(WorkItemsChangedNotification), typeof(WorkItemChangedEvent), typeof(SendEmailNotification) }; } 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 (notificationEventArgs is WorkItemsChangedNotification) { TeamFoundationEventLogger.Log("Received WorkItemsChangedNotification", 0, EventLogEntryType.Information); } else if (notificationEventArgs is WorkItemChangedEvent) { TeamFoundationEventLogger.Log("Received WorkItemChangedEvent", 0, EventLogEntryType.Information); } else if (notificationEventArgs is SendEmailNotification) { TeamFoundationEventLogger.Log("Received SendEmailNotification", 0, EventLogEntryType.Information); } return EventNotificationStatus.ActionPermitted; } #endregion } }
Here is a list of the references from the visual studio project:
- Microsoft.TeamFoundation.Common
- Microsoft.TeamFoundation.Framework.Server
- Microsoft.TeamFoundation.Server.Core
- Microsoft.TeamFoundation.WorkItemTracking.Server
- Microsoft.VisualStudio.Services.WebApi
- System
- System.Core
If I make a change to a work item that triggers an email (I assign a work item to myself), the subscriber receives a SendEmailNotification, but no WorkItemChangedEvent. If I make a change that won't send an email (state change on another work item), the subscriber does not get notified.
We are using TFS 12.0.30626.0 (Tfs2013.Update3.RC) - according to the admin. console.
If anyone has any suggestions of what I'm doing incorrectly, do tell. I'm really at sea here.
Thanks.