Recently, we needed to migrate our project information from SharePoint to Team Foundation Studio. This involved bugs, requirements, etc. Generally, we would edit the XML file and import and so on, but it required a developer to do the work, which of course would take us away from programming. After some research, I found out how, through the GUI supplied by the TFS PowerTools for Visual Studio, this same task can be accomplished. Now, our project manager can happily (I say that sarcastically) add the user stories/bugs into TFS. This GUI allows you to add controls and inputs to the Work Items screens (such as User Stories and Bugs) to help better define the item. Many people familiar with SharePoint know how easy it is to add a new filter type or input control to help more clearly define the item. I hope this will save anybody the trouble of looking up this information on their own, enjoy!
Previously, the XML file would need to be exported, modified, and imported. This generally required a developer to do the work, which of course is tedious, time consuming, and should be done by a project manager or quality department.
Using the code
- You need to go to the website below and download the VS2010 TFS PowerTools. It is an add-on for Visual Studio. Make sure your VS is shut down, and click Download and then 'Run'.
- After the installation is complete (it does take a few minutes), open VS back up. At the top of VS, in the menu bar, you need to expand the menu:
Tools > Process Editor > Work Item Types > Open WIT from Server (click on this).
- A new box will open up, as shown below; expand your project, select the type (for this example, I chose User Story), and click 'OK'.
- The next screen that opens up is essentially the 'guts' of the User Story, allowing you to customize everything on the UI for adding/editing a User Story item. For this example, we are going to add a text box to the classification section to store the name of the source that provided us the User Story. We first need to add a 'type' to reference from the User Story UI. First click 'New', and a screen will open up. We are only going to change the 'Name', 'Reference Name', and 'Help Text' in this screen.
The 'Name' field is what will be written next to the textbox, 'Reference Name' is how it's defined in the TFS database. A good naming convention would be ProjectTitle.Name. Finally, the 'Help Text' is a description of this item we are adding. Change the values to your liking and click 'OK' to save it.
- Next, we want to click on the 'Layout' tab, and find the 'Group - Classification' section. See the screenshot below:
- Now, right click on the 'Column' node under 'Group - Classification' and select 'New Control' from the context menu. On the right will be a Properties window where you just change the 'Label' to whatever you want to be displayed on the actual screen. The 'Type' property lets you choose what type of control it is (i.e., text, date, etc.). In the 'FieldName' property, click and select the 'Reference Name' that we created in step 4. If you followed the suggested naming convention, it will be ProjectTitle.Name.
- When you're all set, you can click 'PreviewForm' to see if it is exactly what you want.
- When complete, make sure you save at the top of Visual Studio.