Click here to Skip to main content
12,760,992 members (30,993 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as


3 bookmarked
Posted 25 Dec 2011

TFS API–Release Notes From TFS Builds

, 26 Dec 2011 CPOL
Rate this:
Please Sign up or sign in to vote.
  Agile taught us to release early and release often, Agile also taught us to get the end user involved more frequently and directly. Goes without saying that release notes are an important part of any release.


Agile taught us to release early and release often, Agile also taught us to get the end user involved more frequently and directly. Goes without saying that release notes are an important part of any release. But what you don’t want to be doing is manually putting together the release notes with each frequent release you do. TFS lets you manage the application lifecycle with great ease & minimal administrative overhead, if your team is already checking in the code against work items and if you are using the TFS build infrastructure, good news is you already have all the raw material for your release notes stored in the TFS repository, in this blog post I’ll show you how to use the TFS API to generate the release notes from the Team builds.

image  So… How does it work?

  •   => Click connect to get all Build Definitions for a Team Project
  •   => Filter by excluding Disabled Build Definitions, or select the no.
  •        of builds to return per build definition, or exclude failed,
  •        partially successful, stopped and in progress builds.
  •   => Click ‘Generate Release Notes’ to generate the release
  •        notes, you can also export the results to PDF 




Let’s get started, follow the steps below or download a working solution & an executable from here.

1. What you need…

To be able to extract the work item details from the build, you need to ensure,

  • Developers check in code against work items – Download and Install TFS Power tools and enable check in policy to enforce check ins against work items.
  • Enable the association of work items with change sets – If you are using the default template that ships with TFS 2010, edit the build definition and under the Process tab in the Advanced settings you will notice the option ‘Associate Change sets and Work Items’ set this to true.


2. TFS API – Programmatically get Work Items, Change sets, etc. from Team Builds

  • 1. Let’s start by connecting to TFS programmatically using the API
<span style="color: blue">   private </span>
  • 2. Get all Build Definitions for the selected Team Project programmatically
<span style="color: green">    // Get All Build Definitions for the selected Team Project
  • 3. Get All Builds in the build definition for specific build Definition specifications programmatically, this helps you narrow down the search and get the selected few filtered results, like in the snippet below, we specify the maximum number of builds to return, what build quality builds to return, etc.
<span style="color: green">     // Get All Builds for the selected build definition 
  • 4. Get Associated Work Items for the selected build. You can also get the Associated Change sets, Build errors, Build Warnings, Work flow details, Changeset Ids, Configuration summaries, Opened work item ids, etc, check for more details for InformationNodeConverters. Notice in the snippet below that I am excluding a work item if it has already been added to the release notes as part of the previous selected build.
<span style="color: green">   // Data I want to display on the report


Next… Create a Report using the Report Wizard and associate it to the Release Note Binding Source. Download a working solution and executable from here.

3. Review & Next Steps…

You can use the same logic with in a custom activity to churn out the release note details in the format you want in the build output, or use the code in a web application , host it in your network and easily let the team query the release notes as and when they need to, or host this in the cloud so the vendors outside the network can easily access the release notes as well, you could also convert this in to a VS extension, right click the build definition and you have the option to generate the release notes. You can also extend the logic further and include more functionality. Happy to hear your feedback! If you have any recommendations or questions, feel free to leave a comment. Thank you for taking the time out and reading this blog post. If you enjoyed the post, remember to subscribe to

Check out the other posts on cool tools using TFS API. In love


Share this post :


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Software Developer (Senior) Avanade
United Kingdom United Kingdom
Solution Developer - C# .NET, ALM

Tarun Arora is a Microsoft Certified professional developer for Enterprise Applications. He has over 5 years of experience developing 'Energy Trading & Risk Management' solutions using Microsoft Technologies. Tarun has great passion for technology and travel (not necessarily in the same order)!

You may also be interested in...

Comments and Discussions

Questioncan't get working Pin
Derek Mahlitz8-Nov-12 8:44
memberDerek Mahlitz8-Nov-12 8:44 
GeneralMy vote of 5 Pin
SledgeHammer0128-Dec-11 10:26
memberSledgeHammer0128-Dec-11 10:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170217.1 | Last Updated 26 Dec 2011
Article Copyright 2011 by Tarun_Arora
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid