Export TFS Work Items to an .XML file (using TFS Power Tools)

TFS Work Items can be easily exported to XMLSteps:

  1. Download Team Foundation Server Power Tools.

  2. On the command line use the TFPT.exe utility to export all work items from a team project in .XML format:

    tfpt query /collection:<URL> /format:xml /wiql:"SELECT * FROM WorkItems WHERE [System.TeamProject] = ‘<TeamProject>’ AND [System.WorkItemType] <> ‘Sprint’ ORDER BY [System.Id]" > WorkItems.xml

    As you can see I selected all work items from the team project excluding Sprint Work Items. Feel free to modify the query, if necessary.

Download: Visual Studio 2010 Project Template for TFS Utilities

If you develop small utilities for Team Foundation Server a lot, you might want to save some time and use a project template (see bottom of post for download link) that already comes equipped with the correct references to the Team Foundation Object Model (Microsoft.TeamFoundation.*.dlls) as well as the most important using statements and a few lines of code to get started.

Installation

Copy the ZIP file to {MyDocuments}\Visual Studio 2010\Templates\ProjectTemplates.

Usage

Create a new project and select “TFS Utility” from the “Visual C#” list.

TFS Utility Project Template 

The template creates a new Windows Forms application with references to the Microsoft.TeamFoundation.*.dlls (btw: the C# compiler gets rid of all references that were not used in the project during compilation)…

 References to Team Foundation Object Model

… as well as a a few using statements and some code to start from.

Generated code in Form1.cs 

Happy TFS tool development!

Download: TfsUtility.zip

Publishing Requirements from Word to TFS (via WordToTFS)

This post is part of a blog series:

Steps:

  1. Download and install the freeware tool AIT WordToTFS from here (registration required).

    WordToTFS - ClickOnce installation 

  2. Start Microsoft Word (winword.exe). You should see a new "WordToTFS" ribbon.

    WordToTFS - Ribbon

  3. Choose the layout template you want to use (the names correspond to TFS process templates, but it’s possible to furhter customize those layout templates).

    WordToTFS - Choosing the layout template

  4. Once, you are ready to publish, click ‘Connect‘ on the ‘WordToTFS’ ribbon and choose a team project to connect to.

    WordToTFS - Connect to TFS

  5. Start by creating an outline, headlines, introduction text as you would normally do when creating a requirements document in MS Word.

  6. Once you are ready to add a requirement, choose "Empty Product Backlog Item" (in the case of the "Visual Scrum Scrum" template; the name differs for other process template, e.g. "Requirement" in MSF/CMMI or "User Story" for MSF/Agile).

    WordToTFS - Creating a new requirement in the word document

  7. This will insert a table with the typical fields to describe a requirement. Replace ‘Title’ and ‘Description’ with appropriate values (you can edit those defaults by clicking "Edit Default Values" on the ribbon).

    WordToTFS - Requirement according to the selected layout template

  8. Repeat Steps 5 to 7 for additional requirements.

  9. Once you’re happy with your requirement(s), click ‘Publish‘ in the ‘WordToTFS’ ribbon.

    WordToTFS - Publish 

    WordToTFS - Saving work items in TFS


    WordToTFS - Publishing results
  10. The work item is now created in TFS.
    After publishing the requirement table looks smilar to this:

    WordToTFS - Default work item layout in MS Word 

Notes:

  • Keep in sync: After initially publishing your work items you can either change those in MS Word and re-publish those changes, or change the work items with a different TFS client and click ‘Refresh’ on the ‘WordToTFS’ ribbon to import those changes into your MS Word document.

    WordToTFS - Keeping your document in sync using Refresh 

  • Images: You can insert images in the description field (if the process template is using an HTML-based field) and those will be updated as attachments:

    SupportForImages
  • Test Cases with Test steps: You can enter a numbered list of steps for a Test Case, which will be translated to test steps (as they are required by Microsoft Test Manager):

    SupportTestCases01

    SupportTestCases02

Disclaimer: This MS Word integration is not part of Visual Studio or Team Foundation Server. The plug-in was developed by a Microsoft Partner (AIT) and not by Microsoft itself.

Exporting TFS Work Items to Microsoft Word (via WordToTFS)

This post is part of a blog series:

Steps:

  1. Download and install the freeware tool AIT WordToTFS from here (registration required).


    WordToTFS - ClickOnce installation

  2. Start Microsoft Word (winword.exe). You should see a new "WordToTFS" ribbon.


    WordToTFS - Ribbon 

  3. Choose the layout template you want to use (the names correspond to TFS process templates, but it’s possible to furhter customize those layout templates).


    image_thumb4 

  4. Click ‘Connect‘ on the ‘WordToTFS’ ribbon and choose a team project to connect to.


    WordToTFS - Connect to TFS 

    If the "missing mapping fields" dialog appears, you probably choose the wrong layout template (you can still change it before the next steps). 

  5. Click ‘Get Work Items" from the ribbon.

  6. On the ‘Get Work Items’ pane to the ride, select a stored query.

    WordToTFS - Get Work Items

  7. Click on ‘Find‘ button.
    Optionally, deselect work items in the list if you want to exclude them.

  8. Click on ‘Import‘ button.


    WordToTFS - Importing Work Items


    WordToTFS - Work Items in an MS Word document
  9. Enjoy!

 

Disclaimer: This MS Word integration is not part of Visual Studio or Team Foundation Server. The plug-in was developed by a Microsoft Partner (AIT) and not by Microsoft itself.

Book Recommendations for Team Foundation Server 2010

(An updated list for TFS 2012 is available here)

This is my personal selection of books covering TFS 2010:

ShowCover_small7 Agile Software Engineering with Visual Studio: From Concept to Continuous Feedback [Sample Chapter]

The book that Sam Guckenheimer (the Product Owner of Visual Studio) and I wrote about how agile software development with agile practices and Scrum as a project management framework can work with the support of VS.
Professional20Team20Foundation20Serv Professional Team Foundation Server 2010

Many useful tips and best practices from experts regarding all parts of TFS 2010.
Recommendation: should not be missing on any desk.
ShowCover6 Software Testing with Visual Studio 2010
Targets specifically testing with VS 2010 and Microsoft Test Manager (MTM).

(Note: There’s a second book with a very similar title.)
Unbenannt1 Inside the Microsoft Build Engine: Using MSBuild and Team Foundation Build (2nd edition)

Specifically about the topic of automated builds
(Note: Only the last half is TFS-related.)
vs2010alm_book_32 Professional Application Lifecycle Management with Visual Studio 2010: with Team Foundation Server 2010 [Sample Chapter]

For getting started: a solid overview over all ALM-related functionality in Visual Studio & TFS 2010.
mzi_rahzirdp_225x225-754 Professional Scrum with Team Foundation Server 2010

A book dedicated to how to do Scrum with TFS 2010.
(Note: I recommend chapters 3, 5 and 11.)

Have fun reading!