Is there any way to either manually remove associated changesets and work items from completed build on Team Foundation Server?
For example: I check-in a changeset, but I make a mistake and I link it with wrong work item. Before I notice that, I create a release build which associates changesets and work items and automatically generates changelog. Now the wrong work item is associated with a build. To fix my mistake, I remove link between work item and changeset. However, there is still link between my completed build and work item. Is there any way to remove the link via user interface or I have to dig down into the TFS API?
I tried to delete my completed build and start a new one, however the work items and changesets that were associated with the deleted build are not associated with new build (even if I deleted the previous build). Does anyone know how to force TFS to associate work items and changesets with the new build?
After doing some research I have stumbled upon this article (https://social.msdn.microsoft.com/Forums/en-US/76462cd5-070f-4fba-8206-550b5511ae68) where someone had similar problem. I have also checked the referenced article on http://www.woodwardweb.com/tfs_top_tip/tfs_top_tip_15.html.
After I deleted the last build, I have also checked the dignostic output from my build and found this line in the log:
Warning: Cannot find the last label 'XXXXXXXXXXXXXXXXXXXX': no changesets will be associated with the build.
And the name of the label that could not be found was exactly the name of the label, created by the deleted build. TFS obviusly remembers the previous label somewhere.
I have checked the TFS collection database and voila, here is the solution:
tbl_BuildDefinition
LastBuildUri
,LastGoodBuildUri
andLastGoodBuildLabel
where: