A tool to create Work Item expressions & manage subscriptions

Update on 7/29/2008: A much more powerful and integrated tool is released now as Power Tools. Check out screen shots, features and download: http://blogs.msdn.com/bharry/archive/2008/07/08/july-08-tfs-power-tool-preview.aspx  

When I was going over past forum questions, I saw that many were having trouble creating filter expressions for event subscriptions, and managing subscriptions. We do have bissubscribe.exe tool that helps with creating subscriptions. But creating subscription expressions is hard because of its syntax. Also, that tool doesn’t give a way to view existing subscriptions to unsubscribe them.

Sam, a formal WIT colleague, developed a tool to help creating workitem tracking subscriptions, but we couldn’t make it a powertoy. I have attached the source for this as  sample code in this post. This source can be built and this can be used as 1) a tool as described above and 2) as a sample to do basic operations with IEventService and ICommonStructureService interfaces.

Here is a screenshot on creating workitem change event expression. It works similar to workitem query builder, but without features such as grouping. The brackets for grouping can be added in Generated XPath textbox, and subscription can be created.

Here is screenshot that shows the existing subscriptions and a way to unsubscribe.

For FAQ on common problems with alerts & troubleshooting, check my post http://blogs.msdn.com/narend/archive/2006/07/27/679571.aspx

[update 4/2/07: Now there is a codeplex project at http://www.codeplex.com/tfseventsubscription to build another tool to achieve this]

//This posting is provided “AS IS” with no warranties of any kind and confers no rights.  Use of samples included in this posting is subject to the terms specified at http://www.microsoft.com/info/cpyright.htm.


Comments (27)

  1. Naren's Blog says:

    I was collecting links & pointers to answer common questions in forums related to TFS eventing…

  2. Un poco de antecedentes:

    Uno de los mecanismos más eficientes para la colaboración que incluye Team…

  3. My VSTS Blog says:

    Subscribing to the TFS Events using bissubscribe.exe is a powerful way to receive notifications for many…

  4. Naren's Blog says:

    I was collecting links & pointers to answer common questions in forums related to TFS eventing and

  5. SRLTeam says:

    There is a lot of useful free utilities for Team System you can find spread all over the web. Some of

  6. Mike's Blog says:

    This is the second article about Ten Must-Have Tools Every TFS User Should Download Now. This article

  7. This is the second article about Ten Must-Have Tools Every TFS User Should Download Now. Part I discusses

  8. Buck Hodges says:

    Jeff has posted a nice GUI for creating event subscriptions. This tool makes the process less arcane

  9. Archi says:

    The Team Alerts dialog lets you subscribe to basic email alerts on a Team Project such as: My work…

  10. I received this from a colleague today and it’s so helpful I thought I’d post it to my blog

  11. TEAM FOUNDATION SERVER Utilities Capacity planning spreadsheet and tools (Unsupported) Team Foundation

  12. A dump, of various tools, thanks to Zeeshan Shah. Note: this is not an endorsed list. Utilities Team

  13. Brian says:

    I have used this tool with mixed results.  Is there a plan to clean it up?  For instance, it does not show in the "manage subscriptions" who it is going to.  Also, there is no way to edit an existing one that I can find.

  14. Mark Phillips says:

    Thanks, I’ve been looking for a clear explanation of how to write Filters for the WorkItemChanged Event.  

    I have created other functionality for TFS and bypassed the ICommonStructureService and went directly to the service.  Pardon for asking, but what is gained by using this proxy. mgphillips1@gmail.com

  15. Kris.K says:

    Hi, if the AssignedTo = "LastName, FirstName", it doesn’t seem to be working. Comma is taken as "OR". Is there an escape character for comma?

  16. Raman says:


    I use  the  tool  .   If  i   want  that  "send  to "  field   should  have  the  email  id   of  the  person  to  whom   i  am  assigning   the   WI ,  then  what  to  do ?


  17. Unfortunately that is not possible yet in V1 Raman. We are working on improving these scenarios for next release.

  18. Patrick B says:

    Naren – I downloaded the tool.  Its extemely helpful.  I am trying to extend it to be able subscribe to event on behalf of others.  Instead of retrieving my ID, I added a field to be able to enter the ID for whom the event is being subscribed.  However, now matter what I include for the UserName parm of the Subscribeevent method, the event is always attached to my ID (in the tbl_subscription table).  I tried entering the users SID as well (from the tbl_sequence_ids table int he TFS DB) to no avail.  

    Do you know whether using the SubscribeEvent method in this fashion is even possible?

  19. Patrick, we are working on a powertool to do what you are asking (even there the event itself will be associated with creater). we hope to release in next 3-6 months.

  20. Patrick B says:

    My bad, I was not seeing this clearly.  It doesn’t really matter what the SID of the subscription notification is.  That is merely the person who created it.  What does matter is the filter and the email address.  I should be able to extend the tool in the manner in which I was thinking.  I will be watching for updates to the tool.

    Thx for the quick response.  

  21. Steve says:


    what if we had Scarlett O’Hara as a member of our development team and we would want to set up email notification for this user name – the apostrophe will destroy the valid xPath syntax:

    ("CoreFields/StringFields/Field[ReferenceName=’System.AssignedTo’]/NewValue" = ‘Scarlett SOH. O’Hara’ OR "CoreFields/StringFields/Field[ReferenceName=’System.AssignedTo’]/OldValue" = ‘Scarlett SOH. O’Hara’)

    Is there any way to get around this issue? Already tried escaping the apostrophe with and '



  22. Steve says:

    Hi again,

    got it working by changing the outer single quotation marks to double as follows:

    ("CoreFields/StringFields/Field[ReferenceName=’System.AssignedTo’]/NewValue" = "Scarlett SOH. O’Hara" OR "CoreFields/StringFields/Field[ReferenceName=’System.AssignedTo’]/OldValue" = "Scarlett SOH. O’Hara")


  23. rye says:


    Do you know where I can find the xpath reference of the other fields in TFS? I am trying to create a notification everytime someone adds my name in the QA field.



  24. jbaiguade says:

    Could you add support for more work item fields?

    For example, I’d like to receive an e-mail when someone changes the estiamtion field, or the date field, etc.


  25. Naren,

    I have an error recorded in Event Viewer of TFS Server.

    TF50285: Exception matching subscription: Microsoft.TeamFoundation.Server.SubscriptionOnServer: System.Xml.XPath.XPathException: ‘/WorkItemChangedEvent/CoreFields/StringField(ReferenceName=’System.AssignedTo’)/NewValue’ has an invalid token.

    After removed event subscription with event type=’WorkItemChangedEvent’, this error has gone.

  26. Gadget News says:

    thanks masykur, that solved the problem

  27. Ismail Ahmed Syed says:

    Hi ,

              Are you upgrading tool for TFS 2010 r any other alternate to perfrm this tasks.