One of the fields that ships with the standard Bug Work Item Type in Team Foundation is called “Found In Build”. It allows the user to enter the build number of the build in which they found the bug. It can be found on the Details tab of the Bug work item.
The “Found In Build” field starts off with the value “<None>” in its drop down list. As Builds are created with Team Foundation Build Automation, the build number is added to this list. This is accomplished by a subscription to the Build Completion Event that was created during installation.
Unfortunately, the default subscription listens for ALL build completions. In other words, even builds that have compilation errors or fail tests, still make it into the list. This can be a real problem for shops that do frequent builds.
The solution is rather simple to say: Remove the default subscription and replace it with a new filtered subscription. But how do you actually do it? Here are the manual steps (the attached solution contains the quick answer):
Filter ==> "CompletionStatus"='Successfully Completed'
BisSubscribe.exe /unsubscribe /id <idFromStep1> /server <tfservername>
BisSubscribe.exe /eventType BuildCompletionEvent /address http://<servername>/WorkItemTracking/v1.0/Integration.asmx /deliveryType Soap /server <tfservername> /filter "\"CompletionStatus\"='Successfully Completed'”
Note: The attached solution contains two projects: