There’s been a couple of questions on the Juvander forums about how to sync comments from the TFS History fieldinto Quality Center.
Unfortunately the TFS Bug Item Synchroniser doesn’t have this feature yet, but there is a way to do it.
Step 1
Create a new ‘QC Comments’ html field in your TFS work item. In my solution this is a read only field on the work item form and is updated from the Comments in the Work Item History field only.
Step 2
Configure the Synchroniser to sync the QC Comments field with the new custom TFS field.
I’ve checked the ‘HTML Formatted Field’ option from QC to TFS but not vice versa and configured an invalid character filter value map for the QC to TFS sync (I also use this on Title and Description)
<ValueMap Name="FilterInvalidChars">
<Value MatchTypeValue="RegularExpressionMatch" ReplaceString=" " PatternString="[^\t\r\n\u0020-\uFFFD]" MatchPatternString="[^\t\r\n\u0020-\uFFFD]" />
</ValueMap>
Step 3
Create a Web Service that subscribes to the WorkItemChangedEvent from TFS
The History field (which if changed will be in the TextFields array) will be populated with any additions, so test the work item change event for an addition and append the comments to the custom ‘QC Comments’ field, marking with ChangedBy for more info. In my solution I also remove the changed field xml by removing everything between ‘<div‘ and ‘div>‘ and exclude ‘Associated with Changeset’ comments.
Now when comments are made in TFS, the web service updates the ‘QC Comments’ field and the Synchroniser updates QC from that. When QC comments are updated the Synchroniser just does a straight update to the ‘QC Comments’ field.