Adding TFS Test Case work item to your Process Template

There are times when you would really like to have the Test Case workitem in your TFS project, this is especially true if you are using Test Manager. Here is a process you can follow to achieve this;

  1. Find a TFS Project that has the Test Case, if not create an empty CMMI Project
  2. Export the required Work Item Templates (WIT) via Visual Studio; Tools->Process Editor->Work Item Types->Export WIT
  3. Choose the Project that has a Test Case WIT and Export ‘Test Case’
  4. Choose the Project that has a Test Case WIT and Export ‘Shared Steps’
  5. Import the files from (3) & (4) into the Project you want to have Test Cases via Tools->Process Editor->Work Item Types->Import WIT
  6. Export the Categories from the source Project using a command prompt from a machine with a TFS client;
  7. witadmin exportcategories /collection:<server name>\<collection> /p:<source project> /f:Catagories.xml

  8. Edit the Categories.xml to match your Projects items, in this example “Use Case” was changed to “Product Backlog Item”;
  9. <?xml version=”1.0″ encoding=”utf-8″?>
    <cat:CATEGORIES xmlns:cat=”http://schemas.microsoft.com/VisualStudio/2008/workitemtracking/categories”>
      <CATEGORY refname=”Microsoft.BugCategory” name=”Bug Category”>
        <DEFAULTWORKITEMTYPE name=”Bug” />
      </CATEGORY>
      <CATEGORY refname=”Microsoft.RequirementCategory” name=”Requirement Category”>
        <DEFAULTWORKITEMTYPE name=”Product Backlog Item” />
      </CATEGORY>
      <CATEGORY refname=”Microsoft.SharedStepCategory” name=”Shared Step Category”>
        <DEFAULTWORKITEMTYPE name=”Shared Steps” />
      </CATEGORY>
      <CATEGORY refname=”Microsoft.TestCaseCategory” name=”Test Case Category”>
        <DEFAULTWORKITEMTYPE name=”Test Case” />
      </CATEGORY>
    </cat:CATEGORIES>

  10. Import the categories.xml into your target Project;
    witadmin importcategories /collection:<server name>\<collection> /p:<target project> /f:Catagories.xml
  11. Close all Visual Studio clients and re-open.
  12.  

Advertisements
This entry was posted in Uncategorized. Bookmark the permalink.

One Response to Adding TFS Test Case work item to your Process Template

  1. Bhanu says:

    Awesome, this helped me allot – Bhanu

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