TFS2012: IntelliSense for customizing Work Item Types using XML

Grant Holliday’s blog

Senior Service Engineer, Microsoft Visual Studio Team Foundation Service

TFS2012: IntelliSense for customizing Work Item Types using XML

  • Comments 0

Team Foundation Server allows you to modify the Work Item Type definitions. You can use a graphical interface like the Process Editor included in the Team Foundation Server Power Tool, or you can edit the raw XML.

For making changes across many work item types, I prefer to edit the raw XML in Visual Studio, since it allows me to use Find & Replace, Copy/Paste, and other useful text-editing functions. 

One very useful feature of Visual Studio is IntelliSense for editing XML files. To activate IntelliSense for XML files, you need to have the XSD schema files in a special directory on your machine.

In this blog post, I will show you how you can enable IntelliSesnse for editing Work Item Tracking XML files. This gives you the flexibility of editing the raw XML, with the safety net of IntelliSense and XML validation. It's based upon an old blog post from Ben Day and updated for Team Foundation Server 2012.

Obtaining the latest schema files

Download here (11KB, Zip file)

Or, you can open Microsoft.TeamFoundation.WorkItemTracking.Common.dll from your GAC in Reflector and export out the schema files which are embedded as resources:

image

Setting them up so IntelliSense works

Extract the XSD files to this folder on your local machine:

C:\Program Files (x86)\Microsoft Visual Studio 11.0\Xml\Schemas

This is where the Visual Studio IntelliSense engine looks for matching schema files, when you open an XML file.

Opening Work Item Type definitions in XML editor, instead of Process Editor

If you have the Team Foundation Server Power Tools installed, the Process Editor plug-in (ProejctTemplateEditor, in the list) is set as the default handler for work item XML files. So you get this UI view, rather than the raw XML:

image

To change this behaviour, you can go to

  • File > Open …
  • Select the Work Item XML file
  • Instead of clicking the ‘Open’ button, click the little arrow next to the ‘Open’ button and choose ‘Open With…’

clip_image001

You can then choose ‘XML (Text) Editor’ and optionally set it as the default editor for these files in the future.

clip_image002

Once you’ve followed all these steps, you get the joy of editing the Work Item Type XML file with the power and syntax checking of IntelliSense.

image

The entire Work Item Type XML schema is documented on MSDN at Index to XML Element Definitions for Work Item Types.