I have just added a new work item type using the witadmin tool:
witadmin.exe importwitd /collection:"http://mytfsserver.com:8080/tfs/myprojcol" /p:"myproj" /f:"mywit.xml"
The import was successful with message:
The work item type import has completed.
I then proceeded to update the categories, referring the new WIT in the RequirementCategory:
witadmin.exe importcategories /collection:"http://mytfsserver:8080/tfs/myprojcol" /p:"myproj" /f:"categories.xml"
I got an error response:
TF237059: The import of the category definition failed. In the type definition,
category Requirement Category refers to a work item type that does not exist mywit.
I tried to get the list of WITs from the server:
witadmin.exe listwitd /collection:"http://mytfsserver:8080/tfs/myprojcol" /p:"myproj"
But my recently added WIT was not on the list.
I tried to remove it:
witadmin.exe destroywitd /collection:"http://mytfsserver:8080/tfs/myprojcol" /p:"myproj" /n:"mywit"
And also get its definition:
witadmin.exe exportwitd /collection:"http://mytfsserver:8080/tfs/myprojcol" /p:"myproj" /f:"mywit.xml" /n:"mywit"
And got the same error response for both requests:
TF201077: The work item type mywit cannot be found. It may have been renamed or destroyed.
But when I opened TFS through web browser, I can create a new item based on the WIT that I have just added.
Is this a TFS bug? How can I make TFS recognize the new WIT that I have just added?
It is a caching problem.
Try running:
Afterwards you should see your recently added WIT.