Home > engineering > TFS Work Item Task Classifications

TFS Work Item Task Classifications

Out of the box TFS ships the Task work item with two fields to support classification, Area and Iteration. It’s pretty obvious what Iteration is for (time), but Area can be a bit confusing. In my experience the issue stems from the fact that multiple user types use the TFS system. So you will get a different answer as to what an Area is based on the type of person you are talking with. People on the product & business side tends to think of areas as functional areas of the system (users, commerce, partners, advertising…); however people on the technical side tend to think of areas as the technical component (public website, database, api, mobile application…). Ive seen examples where companies just combined the two concepts into the Area hierarchy; this doesn’t really do anyone any good. The issue here is that these are really two different concepts with each task actually being associated with both concepts. Example; you can have commerce functionality in both the public website and the database. The solution is really quite easy, but nobody really does it… create a new work item field.

Customizing Work Item Types on Team Foundation Server

Field Definition

<FIELD name=”Component” refname=”TadlockEnterprises.TFS.Apollo.WorkItemFields.Component” type=”String” reportable=”dimension” >
<HELPTEXT>The techincal component.</HELPTEXT>
<ALLOWEDVALUES expanditems=”true”>
<LISTITEM value=”Public Website” />
<LISTITEM value=”Admin Website” />
<LISTITEM value=”API” />
<LISTITEM value=”Database” />
<LISTITEM value=”Foundation” />
<LISTITEM value=”Model” />
</ALLOWEDVALUES>
</FIELD>

Form Definition

<Group Label=”Classification”>
<Column PercentWidth=”100″>
<Control FieldName=”System.AreaPath” Type=”WorkItemClassificationControl” Label=”&amp;Area:” LabelPosition=”Left” />
<Control FieldName=”TadlockEnterprises.TFS.Apollo.WorkItemFields.Component” Type=”FieldControl” Label=”&amp;Component:” LabelPosition=”Left” />
<Control FieldName=”System.IterationPath” Type=”WorkItemClassificationControl” Label=”&amp;Iteration:” LabelPosition=”Left” />
</Column>
</Group>

In the TFS configurations I setup for my clients I have the Area field represent the business concept (because the hierarchy makes more sense here) and create a new flat field for the technical component (Component). I then add this field right next to the Area and Iteration fields in the UI. This Component field is also useful in the Bug work item.

TFS Work Item Classifications

All of this works pretty well. My only complaint with this is that you cant create custom work item fields that use the TreePath type, so you cant make the Component field a hierarchy. I’m sure there is some technical reason why this is the case, but Microsoft should just fix it.