开发者

WorkItemChanged event Client Side

For my current project I have to add a record to a database when a custom workitem changes to specific states. For this you can build a TFS plugin which fires at the WorkItemChanged Event. However our company policies don't allow us to build these plugins because it is processed for each workitem in all projectcollections. This action is only needed for a few team projects.

My question: is it possible to create some clientside plugin(perhaps a VS plugin) which fires an action on this event instead? Or is there someway to create another sort of listener to this event?

Any suggestions would be greatly appreciated, th开发者_JAVA技巧anks in advance.


Instead of having TFS drive the alerts for you, you can implement a polling based alert system.

I would create a simple work item query that selected the work items you were interested in and sorted by the Changed Date column. Then I would write a simple program that used the TFS SDK to run this work item query and notify based on the results, keeping a high water mark between polls. (The TFS SDK samples has an example of running a work item query.)

Note that this polling-based approach has advantages over setting up a SOAP listener regardless of your corporate policy. The SOAP-based alerts system that TFS uses was developed for communication between components of the TFS infrastructure. It's expected that the SOAP endpoint you configure is high availability - if your machine goes down, the SOAP service crashes or your IP address changes, you'll start seeing TFS complaining in the event log. I filled up the event log on my TFS server before I switched to a polling based model for a similar alert system.


In the end I created a custom control for in the WorkItem editform. Within this control I could implement all the required logic for creating the database record.

So instead of setting the combobox state to the onhold state, there now is a button which does exactly the same, executes my custom coding and thus adds a record to our database.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜