Ravendra's Blog

June 2, 2010

Customizing existing work item template TFS 2010

Filed under: Team foundation server 2010 — Ravendra Mishra @ 1:51 pm

Individual work item templates of existing process template can be updated and uploaded back to TFS 2010 project collection. If you update complete process template and upload again it won’t take effect on existing projects, however new projects will use updated one.

In order to make changes on existing template individual work item templates need to be modified and uploaded. Steps will be as below

  1. Get latest version of work item template from server. You may use commands or power tools process template editor for this purpose.
  2. Modify downloaded template to make desired changes. You can do this either using any xml editor or TFS power tools process editor.
  3. Upload modified work item template.
  1. Get latest version of work item template from server

You may use commands for this purpose. To export or list work item types, you must be a member of the Readers group or have your View work items in this node permission set to Allow.

witadmin exportwitd /collection:CollectionURL /p:Project /n:TypeName [/f:FileName] [/e:Encoding] [/exportglobalists]

For further details on this refer the link below:

http://msdn.microsoft.com/en-us/library/dd312129.aspx

Or may use TFS power tools GUI installed with VS2010. Download and install TFS Power tools for Visual studio 2010 from http://visualstudiogallery.msdn.microsoft.com/en-us/3e8c9b68-6e39-4577-b9b7-78489b5cb1da

Navigate to export WIT as below

Then select the project and work item type you want to download.

  1. Modify downloaded template

Modify exported .xml file with any xml editor. I normally prefer Visual Studio IDE. Go to the section where you want to make changes.

In case I need to add new fields etc I prefer to use TFS power tools process editor, its much faster to do this task.

While if I have to add new states and transition etc I would prefer xml editor.

You can add new states as you can see in the picture above and transitions as shown in the picture below.

Save the changes, make sure xml file is valid.

  1. Upload modified template

Now final task is to upload modified template to the project where you want these changes to be effective. Again this step can be done either using commands or power tools GUI

witadmin importwitd /collection:CollectionURL [/p:Project] /f:FileName [/e:Encoding] [/v]

or

Speicify the modified file and the project where this modified work item template need to be uploaded.

In case this need to be uploaded on multiple projects then its better to create a batch file using witadmin commands and execute the batch file once.

Advertisements

1 Comment »

  1. Hi,

    Im using some fields like Name, StartDateTime, EndDateTime, TotalHours. I got the fields in in template now my next task is to put some data in those fields like if it is assigned to a developer i need to track down the starttiem , endtime and total hours spent by the developer. is it possible to do that or not if yes then how? only option that i think of is hooking up those fields to the TFS database but i dont know how to do it and i coudn’t find anything like that on net.
    Any help will be highly appreciated.
    My code for XML is mentioned below

    Comment by Atul — November 24, 2011 @ 2:04 am | Reply


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: