Thursday, November 1, 2007

Using witexport.exe to Generate a TFS WorkItem Type

The "WorkItem" is a very important part of any collaborative development effort. Basically the WorkItem represents a specific task that must be completed by someone in order for the project to move forward. When working with Visual Studio Team System and Team Foundation Server  you will notice that each project has a specific guidance template associated with it. In the case of an out of the box installation, you have the MSF for Agile template and the MSF for CMMI template. Generally speaking, these are good enough for most projects. There are a number of add-on templates available, and Microsoft provides a Process Template Editor (part of the Power Toys now) that allows you to create your own.

In my current project, we are primarily using MSF 4.2 for Agile as our guiding template, but have a need to track both Requirements and Scrum-like sprints. The "Requirement" WorkItem type is included in the MSF for CMMI template that ships with TFS, and the "Sprint" WorkItem type is included with the downloadable eScrum template. The only way to combine these WorkItem types is to extract them from their respective templates and in my case,  import them into the Agile Template.

Exporting a WorkItem Type

Before you can export a WorkItem type, you need to ensure that you have a project created that contains the Type you wish to export. It's probably a good idea to create a project on a development server (Or a sandbox server if you have one available) so that you can keep them around as necessary.

In order to export a WorkItem Type, you must use the witexport.exe utility, which is located in the <install drive>\Program Files\Visual Studio8\Common7\IDE folder. It is actually a very simple utility to use. In my case, the server that I want to connect to is named DEVCIATFS and the project is named CSIDemoeScrum (using the eScrum template). In order to extract the "Sprint Details" WorkItem type, run the witexport.exe utility as follows:


(In case you can't read the capture above, the command line is witexport.exe /f SprintDetails.xml /t DEVCIATFS /p CSIDemoeScrum /n "eScrum Sprint Details" )

The result is a fully-formed XML file that contains the definition for a Sprint Details WorkItem that when imported into TFS looks like this:


No comments: