blogger counters

Tuesday, January 13, 2009

TF26062 Error for Area and Iteration paths

This is a post about Microsoft Team Foundation Server and setting the default iteration for new work items, and why it won't work. We recently had a request to modify a User Story work item so that the default iteration would be \Backlog instead of simply \ (the root of the project). The idea is that new stories added to an agile project should be added to the backlog, and then scheduled into a future iteration.

Work items are defined using XML, and each field on a work item form is defined with a FIELD element in this XML. For most fields you can provide a default value that will be filled in when you create a new work item of that type. This is done using code like this:

<FIELD name="Iteration Path" refname="System.IterationPath" type="TreePath">
    <DEFAULT from="value" value="$$PROJECTNAME$$\Backlog"/>

Unfortunately, this doesn't work. If you try to upload a process template that contains a work item type definition with this code, you'll get an error like this one:

Exception Message: TF26062: Rule '<DEFAULT from="value" value="$$PROJECTNAME$$\Backlog" />' is not supported for the field 'System.IterationPath'.

It turns out the current rules engine for work items doesn't allow setting a default value for either area or iteration when you create a new work item.