Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

TFS 2010 E-mail alerts sometimes don't have "Changed Field" section


View products that this article applies to.

Symptoms

You have Team Foundation Server 2010 SP1.  You have e-mail alerts set up.  When users change only one field in a Task or a Bug work item (other than the "Steps to Repro" field), the resulting e-mail does not have a Changed Fields section.  However, if users change two or more fields, the "Changed Fields" section appears in the e-mail.

↑ Back to the top


Cause

This is a know bug in TFS 2010 SP1.

↑ Back to the top


Resolution

If you look at C:\Program Files\Microsoft Team Foundation Server 2010\Application Tier\TFSJobAgent\Transforms\WorkItemChangedEvent.xsl on the TFS 2010 Application Tier, you will see three sections similar to:

 

<!-- If a field is changed, System.ChangedBy will also be changed. That's at least 2 fields.

           If there is only one field in ChangedFields//Field, it must be System.ChangedBy, which will be ingored.

           So it's safe to use "count(/WorkItemChangedEvent/ChangedFields//Field) > 1",

           rather than count(/WorkItemChangedEvent/ChangedFields//Field) > 1 or (count(/WorkItemChangedEvent/ChangedFields//Field) = 1 and /WorkItemChangedEvent/ChangedFields//Field[1]/ReferenceName[.!='System.ChangedBy'])

        -->

       <xsl:if test="boolean(/WorkItemChangedEvent/TextFields/TextField) or count(/WorkItemChangedEvent/ChangedFields//Field) > 1">

 

That logic is no longer valid since  ChangedDate is excluded from the list of changed fields because it’s a computed column.

 
Perform these steps to fix the code:

  1. Make a copy of the C:\Program Files\Microsoft Team Foundation Server 2010\Application Tier\TFSJobAgent\Transforms\WorkItemChangedEvent.xsl file and save it as a backup. 
  2. Replace “ChangedFields//Field) > 1” with “ChangedFields//Field) > 0” everywhere in the new file.
  3. Save this modified file with its original name in the same folder.
  4. Run a test to see if the e-mails have the proper data.

↑ Back to the top


Keywords: kb

↑ Back to the top

Article Info
Article ID : 2706470
Revision : 1
Created on : 1/7/2017
Published on : 4/25/2012
Exists online : False
Views : 332