Question

I am working on a project where i need to sync data (tickets) from help desk department to TFS and vice-a-versa. i am able to add item in TFS using windows service and its running fine. but, Whenever a work item's status is change in TFS, i want to update the same in Help desk system. so for that i need an event listener kind of things which can listen to TFS work item status change. I am using TFS2010 API and i also looked into ISubscriber. but it look like i need to develop plug-in and put it in somewhere in plug-in folder of TFS installation. I don't want to do it that way, neither using web service directly.

I used following method to subscribe to event.

public static int RegisterWithTFS(TfsTeamProjectCollection server, string eventType, string filter, int port, string receiveMethod)
{
string serviceEndPointURL = String.Format("http://{0}:{1}/{2}", Environment.MachineName, port, receiveMethod);
var preferences = new DeliveryPreference { Schedule = DeliverySchedule.Immediate, Type = DeliveryType.Soap, Address = serviceEndPointURL };

IEventService eventService = (IEventService)server.GetService(typeof(IEventService));
string username = @"mytfsuser";
return eventService.SubscribeEvent(username, eventType, filter, preferences);

}

I want to know a mechanism to trigger my window service (C#) as soon as the work item status change in TFS. so i can able to update it back to my helpdesk system. so can anyone help me for this problem ? Thanks in advance.

Was it helpful?

Solution 2

Finally, i found the solution:

I developed a Tfs server Plugin (instead of Window service) and subscribe to TFS WorkItemChanged event. it Inherits ISubscriber interface and override the ProcessEvent method. I need to deploy this plugin on the TFS Server in plugin folders of Tfs installation. This approach works extremely well!!

OTHER TIPS

You could write a web-service and then subscribe it to TFS Event Service. Reference:

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top