Geeks With Blogs
I [heart] code! .NET musings from the chick side

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".

 ScreenHunter_01 Jun. 23 21 ScreenHunter_02 Jun. 23 21.17

 

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:

ScreenHunter_03 Jun. 23 21.37

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" ?>
<ProcessTemplate>
  <metadata>
    <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">
-     <taskXml>
-         <WORKITEMTYPES>
            <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" />

 </WORKITEMTYPES>
    </taskXml>
  </task>

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:

 

ScreenHunter_05 Jun. 23 22.39

 

This template is now available for me to create a project from:

ScreenHunter_06 Jun. 23 22.40

 

When I select the new template for my new project, I can see the new work item type:

 

ScreenHunter_07 Jun. 23 23.02

 

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!

 

ScreenHunter_08 Jun. 23 23.09

ScreenHunter_09 Jun. 23 23.09

 

 

 

Update: Your TFS User or Group must have been granted the "Manage process template" permission in order to customize the templates.

Posted on Monday, June 23, 2008 11:14 PM | Back to top


Comments on this post: Customize your TFS Template

# re: Customize your TFS Template
Requesting Gravatar...
Unfortunately I the "Download" button is greyed out when I try downloading the template. I guess I need to be the administrator or something but all I am trying to do is to be able to customize so that I do not have to supply the "Area Path" for every workitem I create.
Left by RVG on Jul 03, 2008 1:39 PM

# Thanks for pointing that out...
Requesting Gravatar...
I should have mentioned this in the post...

You do not need to be an admin. All you need is for your user or group to have the "Manage process template" permission.
Good Luck!
Left by Kirstin Juhl on Jul 03, 2008 1:46 PM

# re: Customize your TFS Template
Requesting Gravatar...
I have an existing project that I want to do this to. However, when I upload the new process template the new work item does not appear. Any suggestions? Thanks
Left by Christian on Oct 07, 2008 7:56 PM

# re: Customize your TFS Template
Requesting Gravatar...
Can you actually customize the required fields for different states?
Left by ozlem on Oct 16, 2008 1:28 PM

# Merge your TFS Templates
Requesting Gravatar...
How can i merge two templates in new one???
Left by Mario on Nov 05, 2008 10:15 AM

# re: Customize your TFS Template
Requesting Gravatar...
Christian: Check this link to customize existing projects

http://www.silicusblogs.com/kb/software-development-practices/how-to-customize-the-existing-process-template-in-tfs.html

Hope this helps!
Left by Arsi on Jan 14, 2009 7:41 AM

# re: Customize your TFS Template
Requesting Gravatar...
Hi,

I tried this. New workitem, modify proces template, upload, create a new project. All is well. But when I want to add a new workitem, I do not see my new workitem type in the list of available WITs. Any ideas?

Thanx
Left by Owin on May 14, 2009 7:05 AM

# re: Customize your TFS Template
Requesting Gravatar...
Owin, you may have to refresh your project in Team Explorer before you can see the new work item type or changes to existing work item templates.

Looking at the date of the post, this is probably something that you'll have spotted already.
Left by Andy Murphy on Jul 03, 2009 10:09 AM

# re: Customize your TFS Template
Requesting Gravatar...
Humm... interesting,

great explanations, loadsa info in there great article altogether, well done

Thanks for bringing this up
Left by Web developers on Oct 08, 2009 10:58 AM

# re: Customize your TFS Template
Requesting Gravatar...
One question that I have is, when you add suggested field values to a field, They are automatically sorted alphabetically when displayed. Is there a way to prevent the automatic sorting?
Thanks,
Jyapu
Left by Jyapu on Oct 27, 2009 2:34 PM

# re: Customize your TFS Template
Requesting Gravatar...
I am having the same issue as Owin. I completed all the steps yet the custom WIT is not displaying in my list even after a refresh. Do I have to make these WIT's on the server itself? Right now I am working from Team Explorer remotely. Help please!

Thanks,
Brenda
Left by Brenda on Feb 02, 2010 1:40 PM

# re: Customize your TFS Template
Requesting Gravatar...
We have been able to make the changes and apply to a NEW project. But are having trouble with how to update an existing project.

So, Project A was created with Template A - and I want to add a new WI to Template A and any projects which use that template. Is there a way to do this?

Thanks!
Left by Stacy on Mar 05, 2010 11:50 AM

# re: Customize your TFS Template
Requesting Gravatar...
Very good article. Helped a lot.
Thanks
Left by Anjoli on Sep 21, 2011 12:58 AM

# re: Customize your TFS Template
Requesting Gravatar...
really a helpful article.
Left by Ashlesh on Apr 16, 2012 3:25 AM

Your comment:
 (will show your gravatar)


Copyright © Kirstin Juhl | Powered by: GeeksWithBlogs.net