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;
- Find a TFS Project that has the Test Case, if not create an empty CMMI Project
- Export the required Work Item Templates (WIT) via Visual Studio; Tools->Process Editor->Work Item Types->Export WIT
- Choose the Project that has a Test Case WIT and Export ‘Test Case’
- Choose the Project that has a Test Case WIT and Export ‘Shared Steps’
- Import the files from (3) & (4) into the Project you want to have Test Cases via Tools->Process Editor->Work Item Types->Import WIT
- Export the Categories from the source Project using a command prompt from a machine with a TFS client;
- Edit the Categories.xml to match your Projects items, in this example “Use Case” was changed to “Product Backlog Item”;
- Import the categories.xml into your target Project;
witadmin importcategories /collection:<server name>\<collection> /p:<target project> /f:Catagories.xml - Close all Visual Studio clients and re-open.
witadmin exportcategories /collection:<server name>\<collection> /p:<source project> /f:Catagories.xml
<?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>
Awesome, this helped me allot – Bhanu