Answered Comparing fields of a Work Item when filtering event notification

  • Monday, April 10, 2006 8:39 PM
     
     

    Hi,

    I'm having some troubles setting the Event Filter when subscribing to the WorkItemChangedEvent.

    I need to compare two values of the work item. For example, I want to know if the Assigned To field was changed. I tried the following:

    "CoreFields/StringFields/Field[ReferenceName='System.AssignedTo']/OldValue" <> "CoreFields/StringFields/Field[ReferenceName='System.AssignedTo']/NewValue"

    but notifications always are sent even if the Assigned To field didn't change.

    Am I doing something wrong?

    Thanks a lot!

All Replies

  • Wednesday, April 12, 2006 12:26 AM
     
     Answered

     

    I'm afraid the filtering only does comparisions with constants on the right side of the operator, so this doesn't work.  It is treating the expression on the right as a constant, and always evaluating to true.  Since "Assigned To" is a core field, it is always present in each work item change event, so you cannot use its presence as an indicator.  If notification is arriving in the form of a webmethod, you can receive all notifications and then check the values programmatically.  If it is arriving as an email, however, you can't.

     

  • Wednesday, April 12, 2006 3:12 AM
     
     

    Thanks Pete for the answer!

    I'm using SOAP notification and I was doing what you suggested, to check the values programatically in the web service. But I wanted to avoid unnecessary notifications...

    I hope future versions will support making this kind of comparisons to avoid using more bandwidth than needed.

    Cheers,