TFS Timesheets - Configuration

There are two key steps required in order for the TFS Timesheets component to work for Team Foundation Server work items.

  • Install the TFS Timesheets extensions on each client machine (i.e. on each developer machine running Visual Studio).  Note that the TFS Timesheets installer does not need to be run on the TFS 2010 Server itself.
  • Configure Team Foundation Server work items to include the timesheet control.

The first step can be done by simply running the latest TFS Timesheets installer from http://tfstimesheets.codeplex.com.   Note that all files are installed to [AppData]\Microsoft\Team Foundation\Work Item Tracking\Custom Controls\10.0, as opposed to the selected installation path.  This is due to this being the only folder Visual Studio looks in by default for custom work item controls.

TFS Timesheets 2.0 installs to %programFiles(x86)%\TFS Timesheets.  A registry entry is then added to HKCU\Software\Microsoft\VisualStudio\11.0_Config\WorkItemTracking\CustomControls\LookInFolders with this path.

The second step is a little more involved.

1. Select the Work Item type that you want to add the timesheet control to.  The only pre-requisite is that the work item control must also support the following fields

  • Remaining Work (Microsoft.VSTS.Scheduling.RemainingWork)
  • Completed Work (Microsoft.VSTS.Scheduling.CompletedWork)

For the purposes of this documentation, I am using the “Task” work item from the MSF for Agile v5.0 guidance pack.

2. Export the current work item from Team Foundation Server

C:\>”C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\witadmin” exportwitd /collection:localhost\defaultcollection /p:”{ExistingProject}” /n:Task /f:Task.xml

3. Open Task.xml in your favourite XML editor. Note that it might be necessary to edit this file in an editor other than Visual Studio if you have the Team Foundation Server Process Editor installed as this will cause the xml file to be opened using the GUI control. You can of course use the Process Editor to configure TFS Timesheets, but the instructions will differ slightly from those documented here.

4. Add a new field to the Task work item:

<WORKITEMTYPE name="Task">

<FIELDS>

<FIELD name="TimesheetRawData" refname="Custom.Timesheets.TimesheetRawData" type="PlainText" />

5. Add the Timesheet Control. I tend to place this into the tab group at the bottom of the default work item layout.

<TabGroup>

<Tab Label="TimeSheets">
<Control Type="WorkItemTimeSheetControl" LabelPosition="Top" FieldName="Custom.Timesheets.TimesheetRawData" />
</Tab>
</TabGroup>

6. Re-import the work item into Team Foundation Server

C:\TFS>”C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\witadmin” importwitd /collection:localhost\defaultcollection /p:”{ExistingProjectName}” /f:Task.xml

An optional further step would be to add the modified work item definition to a customised process template, to ensure that future Team Projects created automatically have the control included.

Last edited Sep 28, 2012 at 2:56 AM by cromwellryan, version 6

Comments

IvanaSimunic Jun 18, 2013 at 6:48 PM 
Hi!
I need some help please!
I'm trying to install the timeSheets in order to administrate better my project resources.
I've done everything explained here and I'm getting this error: "Exception has been thrown by the target of an invocation" in TimeSheets Tab.

Does anybody knows what could be happening? Please! I'm stucked with this error since frideay!!

I have Team Foundation Server 2010 and VS 2010 installed.

Thanks in advance!!