Thursday, May 26, 2011

Create a TFS Field that contains Assigned Date

The default TFS workitems does not have a field that records last “Assigned To” date. You can easily create a new field to record this date

Start by creating a new Field Definition

AssignedToDateField_Create

Create a new rule of type WHENCHANGED

SNAGHTML8f39e02

Select Field System.AssignedTo

WhenChanged

Create a new rule of type SERVERDEFAULT

SNAGHTML8f5a976

Select from “clock”

SNAGHTML8f63fbc

The field Assigned Date is now created and will be updated when the workitem is assigned or re-assigned.

If you prefer to modify the XML directly here is the snippet:

 <FIELD name="Assigned Date" refname="NTS.AssignedDate" type="DateTime" reportable="dimension">
        <WHENCHANGED field="System.AssignedTo">
          <SERVERDEFAULT from="clock" />
        </WHENCHANGED>
      </FIELD
>

2 comments:

Seth B said...

Very helpful article, thanks! I wanted to point out that with this approach, the timestamp will be updated every time the work item is reassigned, which may or may not be what is needed.

In my case, I wanted to be able to calculate the amount of time lapsed between the work item being created and being assigned, so I created a DEFAULT rule (as opposed to SERVERDEFAULT) that only applies the timestamp if the "Assigned Date" was previously empty.

Again, thanks for the post!

Unknown said...

Deal with new work itens




after one new