In the default TFS configuration a team is mapped to an area path. If your organization has several teams that work from a common backlog and across many product areas, this configuration might not fit how you want to organize your work. In this case you can add a custom field which represents the team. By doing this, you decouple the assignment to teams and your area paths.

The team field

The custom field (team field)

With the default TFS configuration you have two dimensions that apply on workitems:

  1. The area path – A team is mapped to an area path, so this dimension is used to decide on which team backlog the workitem is presented.
  2. The iterationpath – This is used to decide when a team can start developing the workitem

When using the teamfield you add a new dimension:

  1. The area path – This dimension can be used as product area
  2. The iterationpath – This is used to decide when a team can start developing the workitem
  3. The team field – This is used to decide on which team backlog a workitem is presented

Configure Team Foundation Server

There are a couple of things you have to do, to have a team field in your workitems.

  1. Create a global list with teams
  2. Add the custom field to all the backlog workitems (user-story, task, bug)
  3. Change the process configuration to support the team field
  4. Configure your teams

Creating the global list with teams

To create a global list with teams you have to export the global list definition, add a new global list, and import the updated list definition.

You can get the global list definition by using witadmin.exe (component of Visual Studio):

cd %programfiles%\Microsoft Visual Studio 12.0\Common7\IDE\
witadmin.exe exportgloballist /collection:"http://Server:8080/tfs/DefaultCollection" /f:c:/temp/globallist.xml

Open the global list definition and make sure your definition looks a bit like:

<?xml version="1.0" encoding="utf-8"?>
<gl:GLOBALLISTS xmlns:gl="http://schemas.microsoft.com/VisualStudio/2005/workitemtracking/globallists">
   <GLOBALLIST name="Teams">
      <LISTITEM value="Unassigned"/>
      <LISTITEM value="Team A"/>
      <LISTITEM value="Team B"/>
   </GLOBALLIST>
</gl:GLOBALLISTS>

Upload the list to TFS using the following command (make sure you are project administrator and have Visual Studio installed)

witadmin.exe importgloballist /collection:"http://Server:8080/tfs/DefaultCollection" /f:c:/temp/globallist.xml

Add the team field to workitems

The next step is to add the team field to your workitems. The procedure to do to this looks a bit like adding a global list. First you have to export the workitem types, edit the XML of the workitem types and import them back into TFS.

Export the workitems by using the following commands:

witadmin.exe exportwitd /collection:"http://Server:8080/tfs/DefaultCollection" /p:Project /n:"Product Backlog Item" /f:c:/temp/pbi.xml
witadmin.exe exportwitd /collection:"http://Server:8080/tfs/DefaultCollection" /p:Project /n:Bug /f:c:/temp/bug.xml
witadmin.exe exportwitd /collection:"http://Server:8080/tfs/DefaultCollection" /p:Project /n:Task /f:c:/temp/task.xml

For each workitem type add a reference to the custom list:

<FIELDS>
*
   <FIELD name="Team" refname="Company.Team" type="String" reportable="dimension">
      <HELPTEXT>Name of the team that will do the work.</HELPTEXT>
      <ALLOWEXISTINGVALUE />
         <ALLOWEDVALUES >
            <GLOBALLIST name="Teams" />
         </ALLOWEDVALUES >
         <DEFAULT from="value" value="Unassigned" />
   </FIELD>
*
</FIELDS>

Also extend the form so you can select a team:

<FORM>
*
   <Group Label="Status">
      <Column PercentWidth="100">
         <Control FieldName="Company.Team" Type="FieldControl" Label="Activity" LabelPosition="Left" EmptyText="&lt;None&gt;" />
         <Control Type="FieldControl" FieldName="System.AssignedTo" Label="Assi&amp;gned to:" LabelPosition="Left" />
         <Control FieldName="System.State" Type="FieldControl" Label="Stat&amp;e" LabelPosition="Left" />
         <Control FieldName="System.Reason" Type="FieldControl" Label="Reason" LabelPosition="Left" ReadOnly="True" />
         </Column>
   </Group>
*
</FORM>

Import the workitem types back into TFS:

witadmin.exe importwitd /collection:"http://MyServer:8080/tfs/DefaultCollection" /p:Project /f:c:/temp/pbi.xml
witadmin.exe importwitd /collection:"http://MyServer:8080/tfs/DefaultCollection" /p:Project /f:c:/temp/bug.xml
witadmin.exe importwitd /collection:"http://MyServer:8080/tfs/DefaultCollection" /p:Project /f:c:/temp/task.xml

Changing the process configuration

This is the last step where we use witadmin.exe. In this step we will export the process configuration of the teamproject, add the team field to it, and import it into TFS.

witadmin.exe exportprocessconfig /collection:"http://server:8080/tfs/DefaultCollection" /p:Project /f:c:/temp/ProcessConfiguration.xml

Add the team field to the configuration:

<TypeField refname="company.Team" type="Team" />

Import the configuration to TFS:

witadmin.exe importprocessconfig /collection:"http://server:8080/tfs/DefaultCollection" /p:Project /f:c:/temp/ProcessConfiguration.xml

Configuring your teams

The next stap is to configure your teamproject. This can be done via the webinterface of TFS.

  1. Navigate to the backlog of your team.
  2. Click on “Select team areas”
  3. In the dropdown select your team.
  4. Click on save changes

You team field is now ready to use!

Share This