TFS 2010 - Customization of Work Item Type Definition (Part 1)
Posted by: Subodh Sohoni ,
on 8/22/2011,
in
Category VSTS & TFS (Azure DevOps)
Abstract: With this article, we will start a series of articles to review the customization of work item type definition in the context of changes that we observe in work item tracking in TFS 2010. In this article, we will cover the tools and process to export work item type definition from an existing team project and then import it back with some modifications. We will use command line tools and XML editing in the notepad. We will also see how to export and import Global Lists from TFS.
With this article, we will start a series of articles to review the customization of work item type definition in the context of changes that we observe in work item tracking in TFS 2010. Sometime back, I had written a series of articles on customization of work item type definition starting with VSTS - Workitem Architecture, Design Considerations and Customization: Part 1. In TFS 2010, Microsoft has introduced new tools like Team Foundation Power Tools to do the work item type definition customization, Microsoft Test Manager 2010 and new concepts like hierarchical work items, categorization of work items etc. TFS 2010 also has new work item types like Test Case and Shared Steps.
Update: Part 2 of this article can be viewed over here TFS 2010 - Edit Work Item Type Definition using Team Foundation Power Tool
We take up a case of work item type Defect instead of Bug. Many organizations use the term defect in place of Bug and they are comfortable keeping that same term in TFS also. We will begin with getting the definition of work item of the type Bug. We will do the simple necessary modifications in it using a tool built in TFS 2010 that is called WitAdmin. This modification will create a new work item type called Defect in a team project. Then we will use the Team Foundation Power Tool (download from http://visualstudiogallery.msdn.microsoft.com/c255a1e4-04ba-4f68-8f4e-cd473d6b971f )to do more complex modification like addition of field, change layout and workflow of the work item. Finally we will also see how we make the Microsoft Test Manager 2010 aware of this change so that by default it will create an instance of Defect rather than Bug work item type. I am going to walk you through the process step by step. For the sake of doing it practically I have used the Virtual Machine provided by Brian Keller (Microsoft Sr. Technical Evangelist for Visual Studio Application Lifecycle Management). It can be downloaded from http://blogs.msdn.com/b/briankel/archive/2010/06/25/now-available-visual-studio-2010-rtm-virtual-machine-with-sample-data-and-hands-on-labs.aspx. In case you do not want to download that virtual machine, you can work with any installation of TFS 2010 and Visual Studio 2010 (Ultimate or Test Professional 2010). If you do not want to do it practically then also the screenshots in each step will give you complete idea of the process.
We begin with getting the Bug work item type definition in a XML file.
Step 1: Ensure that virtual machine named Visual Studio 2010 RTM is open and you are logged on as Administrator to it.
Step 2: Open windows explorer and create a folder named WITD on the C drive.
Step 3: Open the Visual Studio 2010 Command Prompt and Run it as administrator. To do that go to Start – All Programs – Microsoft Visual Studio 2010 – Visual Studio tools – Right click on Microsoft Visual Studio Command Prompt (2010) and select Run as Administrator from the menu.
Step 4: Enter following command:
WitAdmin ExportWitd /collection:http://localhost:8080/tfs/DefaultCollection /p:”Tailspin Toys” /n:Bug /f:”C:\WITD\Bug.xml”
Step 5: Operation Complete message will appear below the command that you had typed
Now that we have the Bug work item type definition in a XML file, we will simply edit it in Notepad.
Step 6: In the Windows Explorer you will find the file Bug.xml is created. Select that and open it for editing.
Step 7: It will open in notepad where we can edit it now
Step 8: Change the name from Bug to Defect and save the file.
And now we will import it back in the TFS 2010 in the same team project. We may as well import it in another TFS and / or other project too without any issue.
Step 9: Use the command
WitAdmin ImportWITD /collection:http://localhost:8080/tfs/DefaultCollection /p:"Tailspin Toys" /f:"C:\WITD\Bug.xml"
Step 10: You will get a message that Work Item Type Import has completed
Step 11: You may now start Visual Studio 2010, open Team Explorer and browse to the Team Project named Tailspin Toys. Expand to the Work Items node and right click on it. Select the option New Work Item and you will find Defect appear in the list.
We will now create a Global List that we will be using in the Defect work item type definition. Global lists are as the name suggests, list of items that can be used in any work item to assign values to any field. We will export existing Global Lists in an XML file and then add our Global List to it and then save it under the TFS.
Step 12: To export global lists, in the same command prompt type command:
WitAdmin ExportGlobalList /collection:http://localhost:8080/tfs/DefaultCollection /f:"C:\WITD\GL.xml"
You will get a message that Global Lists has been exported.
Open the GL.xml to edit in notepad and just before the tag </gl:GLOBALLISTS> add following tags
<GLOBALLIST name="Organizational Divisions">
<LISTITEM value="Paper Airplanes" />
<LISTITEM value="Model Aircrafts" />
<LISTITEM value="Model Helicopters" />
<LISTITEM value="New Projects" />
</GLOBALLIST>
Step 13: Save the file GL.xml in the same folder (C:\WITD) and close notepad.
Step 14: At the command prompt enter command
WitAdmin ImportGlobalList /collection:http://localhost:8080/tfs/DefaultCollection /f:"C:\WITD\GL.xml"
You will get message that Global list was successfully imported.
We will use this Global list in the next part of customization of work item type definition using Team Foundation Power Tool.
Update: Part 2 of this article can be viewed over here TFS 2010 - Edit Work Item Type Definition using Team Foundation Power Tool
Summary: In this article, we have covered the tools and process to export work item type definition from an existing team project and then import it back with some modifications. We used command line tools and XML editing in the notepad. We have also seen how to export and import Global Lists from TFS. In the next article in the series, I will walk you through the use of Team Foundation Power Tool for editing the work item type definition.
This article has been editorially reviewed by Suprotim Agarwal.
C# and .NET have been around for a very long time, but their constant growth means there’s always more to learn.
We at DotNetCurry are very excited to announce The Absolutely Awesome Book on C# and .NET. This is a 500 pages concise technical eBook available in PDF, ePub (iPad), and Mobi (Kindle).
Organized around concepts, this Book aims to provide a concise, yet solid foundation in C# and .NET, covering C# 6.0, C# 7.0 and .NET Core, with chapters on the latest .NET Core 3.0, .NET Standard and C# 8.0 (final release) too. Use these concepts to deepen your existing knowledge of C# and .NET, to have a solid grasp of the latest in C# and .NET OR to crack your next .NET Interview.
Click here to Explore the Table of Contents or Download Sample Chapters!
Was this article worth reading? Share it with fellow developers too. Thanks!
Subodh is a Trainer and consultant on Azure DevOps and Scrum. He has an experience of over 33 years in team management, training, consulting, sales, production, software development and deployment. He is an engineer from Pune University and has done his post-graduation from IIT, Madras. He is a Microsoft Most Valuable Professional (MVP) - Developer Technologies (Azure DevOps), Microsoft Certified Trainer (MCT), Microsoft Certified Azure DevOps Engineer Expert, Professional Scrum Developer and Professional Scrum Master (II). He has conducted more than 300 corporate trainings on Microsoft technologies in India, USA, Malaysia, Australia, New Zealand, Singapore, UAE, Philippines and Sri Lanka. He has also completed over 50 consulting assignments - some of which included entire Azure DevOps implementation for the organizations.
He has authored more than 85 tutorials on Azure DevOps, Scrum, TFS and VS ALM which are published on
www.dotnetcurry.com.Subodh is a regular speaker at Microsoft events including Partner Leadership Conclave.You can connect with him on
LinkedIn .