I am writing a simple custom work item browser and I'd like it to follow the real-time changes happening to work items on my TFS server.
For example, if someone has changed a work item's Title or State, I'd update my work item tree with this new information.
How can I subscribe to such events?
You can use the TFS eventing mechanism to subscribe a web service endpoint to get notified when a work item changes. However this is designed for server->server communication and this push notification mechanism does not work well for client applications.
Instead I would recommend that you use the TFS .NET Api to poll the server periodically for updates. To make the poll operation efficient after you have got a full set of results using your query, you could modify the WIQL to just look for work items where the changed date is greater than the last time that you polled the server.
The reason the "pull" model works better than the "push" model in this case is as follow:
Hope that makes sense.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With