Scribe - Test Scribe is a documentation power tool designed to construct documents directly from TFS for test plan and test run artefacts for the purpose of discussion, reporting etc. Scribe only works with Microsoft Test Manager, so if you needed to generate documentation for TFS Builds, what options do you have? You could potentially modify the Build Process template to generate report documentation as the build is executed or you could use the TFS data warehouse to extract data to create rich reports or use the TFS API like I did to create Release Notes.
Recently I stumbled upon Build Manager, build manager is a solution developed by the ALM Rangers, it is intended to ease the management of builds in medium to large Team Foundation Server environments, though it does provide a few features which all users may find useful. You can check out the feature offering in the latest release here. So… I decided to extend Build Manager to create a prototype for Scribe like functionality to generate Build Notes.
Download Source
Download the source and demo executable from here, unzip the contents, you should get the folder structure “..\tfsbuildextensions-72864\TFSBuildManager\MAIN”
- Demo => “..\tfsbuildextensions-72864\TFSBuildManager\MAIN\Demo\TFSBuildManager.Application.exe”
- Source => “..\tfsbuildextensions-72864\TFSBuildManager\MAIN\Source\TFSBuildManager.sln”

Feature Walkthrough
- Open the source code from “..\tfsbuildextensions-72864\TFSBuildManager\MAIN\Source\TFSBuildManager.sln” and set “TFSBuildManager.Application” as the start up project.
- Fire up the build Manager and load builds from across build definitions,

- Select the builds you would like to generate the build notes for | right click and from the context menu choose Build Notes

- Select what you want, mission reduce unnecessary noise!
- I am using Open XML SDK for Microsoft Office to generate the build notes, so even if the client does not have Microsoft Office installed the build notes would be generated. I used the Open XML SDK 2.0 Productivity Tool – which let’s you reflect the code for an existing word document. Though at present I have not spend too much time abstracting the template logic [but this is still a prototype
so I guess that’s acceptable]. I found a very useful walkthrough here that helped me create the build notes template.
And the final few lines of magical code…
public void GenerateBuildNotes(IEnumerable<IBuildDetail> buildDefinitions, BuildNoteOptionsEnum noteOptions)
{
var builds = buildDefinitions.ToArray();
// Pass Values to Template to create the document
var path = String.Format("{0}\\{1}.doc", Path.GetTempPath(), Guid.NewGuid());
Template template = new Template(path, builds, noteOptions, _workItemStore);
template.CreatePackage();
// Open the document
Process.Start(path);
}
- I have bulk tested this for around 125 builds and usually completes in less than a couple of seconds


I need your Help!
Now what I have done so far is a skeleton structure – Build Details, Work Item Details and Change set Details (Download), I want to make build notes comprehensive, but at the same time, the user has the option of enabling/disabling what they want included in the build notes. I need your suggestion on what information would you like to see in the build notes. Some possibilities that come to my mind as I finish this post,
- Build Completing time
- Test Execution Status
- Flag to indicate whether change set is a result of merge
- File details in the change set
You can download the source and have a play around, looking forward to your feedback on further features that can be added to the build notes.
Thank you for taking the time out and reading this blog post. If you enjoyed the post, remember to subscribe to http://feeds.feedburner.com/TarunArora.
Check out the other posts on cool tools using TFS API. 