One of the questions that came out of my TFS talk at the Magenic Technology Summit was:
How do you go about customizing one of the existing templates provided for TFS, such as MSF Agile? We may want to add new types for Work Items, for example, or add new states that work items can be in.
The easiest way to do this is through the Visual Studio Team System 2008 Team Foundation Server Power Tools.
If you do not have the Power Tools installed, you can still do this by editing the XML that makes up the templates.
First, get the existing template that you want to customize by clicking Team > Team Foundation Server Settings > Process Template Manager. Select the template you want to customize by selecting it and click "Download".
The process template will be downloaded to the specified directory. The process template is nothing more than a set of XML files organized into folders by function. The top-level folder is the name of the template.
In this case, I have downloaded the MSF for Agile Software Development - v4.2:
I HIGHLY suggest changing the name of the template as your first modification, so that if you mess up the template (easy to do), you can start over by downloading the unchanged vanilla template. A this point I also change the name of the top-level directory for the Process Template.
In ProcessTemplate.xml, make the following changes:
<?xml version="1.0" encoding="utf-8" ?>
<name>MSF for Agile Software Development - v4.2 - MODIFIED</name>
Now you are ready to create a new type of work item.
First, open workitems.xml and add your new work item type:
- <task id="WITs" name="WorkItemType definitions" plugin="Microsoft.ProjectCreationWizard.WorkItemTracking" completionMessage="Work item types created">
<WORKITEMTYPE fileName="WorkItem Tracking\TypeDefinitions\Bug.xml" />
<WORKITEMTYPE fileName="WorkItem Tracking\TypeDefinitions\Task.xml" />
<WORKITEMTYPE fileName="WorkItem Tracking\TypeDefinitions\Qos.xml" />
<WORKITEMTYPE fileName="WorkItem Tracking\TypeDefinitions\Scenario.xml" />
<WORKITEMTYPE fileName="WorkItem Tracking\TypeDefinitions\Risk.xml" />
<WORKITEMTYPE fileName="WorkItem Tracking\TypeDefinitions\NewWorkItemType .xml" />
Next you need to create the template for your work item type: in the TypeDefinitions folder, open the XML for the work item most like the new one that you are creating.
The FIRST step is to save this XML document with the new name. The name is the what you typed into the ProcessTemplate.xml, in this case, "NewWorkItemType.xml"
After you have saved the new template, you can make the modifications that you need.
In the <FIELDS> section, you can delete, modify, or add the fields that you want to appear on your new work item type.
In the <WORKFLOW> section, you can add, modify, or delete states for your new work item.
For example: to add a new state called "Estimate", you would add the following xml to the <WORKFLOW><STATES> section:
<STATE value="Estimate" /> </STATE>
Here, you can also set field values and transition behavior - topics that will be covered in a future post.
When you are finished with your modifications, you can Upload the process template the same way that you downloaded it, by browsing to the new folder and clicking "Upload".
Here you can see my Process Template Dialog after a successful Process Template upload:
This template is now available for me to create a project from:
When I select the new template for my new project, I can see the new work item type:
Using the Power Tools gives us a graphical interface to the process templates: A few screen shots are shown, but we will not go into using the Power Tools here. Using the Power Tools is a much easier and safer way to modify your process templates, and I highly recommend that you download them and give them a whirl!
Update: Your TFS User or Group must have been granted the "Manage process template" permission in order to customize the templates.