Naren's Blog

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.

Published Wednesday, July 26, 2006 9:32 PM by narend

Attachment(s): WorkitemEventSubscriptionTool.zip

Comments

 

Naren's Blog said:


I was collecting links & pointers to answer common questions in forums related to TFS eventing...
July 26, 2006 7:20 PM
 

B³: Beto Borbolla Blog said:

Un poco de antecedentes:
Uno de los mecanismos más eficientes para la colaboración que incluye Team...
July 27, 2006 12:33 AM
 

My VSTS Blog said:

Subscribing to the TFS Events using bissubscribe.exe is a powerful way to receive notifications for many...
July 27, 2006 9:26 PM
 

Naren's Blog said:

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

October 12, 2006 8:16 PM
 

SRLTeam said:

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

November 3, 2006 1:46 AM
 

Mike's Blog said:

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

December 12, 2006 4:21 PM
 

It's Way Too Early For This said:

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

December 13, 2006 11:34 AM
 

Buck Hodges said:

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

February 26, 2007 9:49 PM
 

Archi said:

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

February 27, 2007 3:32 AM
 

It's Way Too Early For This said:

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

March 9, 2007 12:43 AM
 

It's Way Too Early For This said:

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

March 9, 2007 2:08 AM
 

Team Individualism said:

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

March 11, 2007 6:34 PM
 

Brian said:

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.

April 23, 2007 4:50 PM
 

Mark Phillips said:

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

May 1, 2007 4:51 PM
 

Kris.K said:

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?

August 7, 2007 1:48 PM
 

Raman said:

Hi

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 ?

Thanks

February 8, 2008 1:19 AM
 

narend said:

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

February 8, 2008 12:04 PM
 

Patrick B said:

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?

May 7, 2008 1:44 PM
 

narend said:

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.

May 7, 2008 1:54 PM
 

Patrick B said:

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.  

May 7, 2008 6:21 PM
 

Steve said:

Hi,

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 '

Thanks,

Steve

July 29, 2008 4:56 AM
 

Steve said:

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")

Steve

July 29, 2008 5:32 AM
 

rye said:

Hi,

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.

Cheers!

Ryan

September 29, 2008 12:57 PM
 

jbaiguade said:

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.

Thanks!

November 14, 2008 8:52 AM
 

Ahmad Masykur said:

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.

May 27, 2009 9:48 PM
Anonymous comments are disabled

© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Microsoft
Page view tracker