Bookmark and Share

Don’t Close Work Items with Remaining Hours

Project management doesn’t seem to like it when they generate reports from Team Foundation Server and see tons of hours remaining for work that should have already be completed. In my organization, it’s not due to lazy developers not completing their tasks, but people tend to forget to zero out the remaining hours in their tasks before closing it. Luckily, there’s a way to fix that.

Open up a command prompt and change directories to %ProgramFiles%\Microsoft Visual Studio 10.0\Common7\IDE. Then run the following command replacing <url> with the url to your team project collection.

witadmin exportwitd /collection:<url> /p:<ProjectName> /n:Task /f:task.xml

You will need to edit the templates of the various work items if you want this for more than task. Edit task.xml and find the TRANSITIONS section. Find <TRANSITION from="Active" to="Closed">. Then, under the FIELDS section put the following snippet of xml.

            <FIELD refname="Microsoft.VSTS.Scheduling.RemainingWork">
              <ALLOWEDVALUES expanditems="true">
                <LISTITEM value="0" />
              </ALLOWEDVALUES>
            </FIELD>

Save the file and import it back to TFS.

witadmin importwitd /collection:<url> /p:<ProjectName> /f:task.xml

Now, any time someone attempts to close an active work item, they will receive a warning… and an error if they actually try to save.

RemainingWork

This may be a minor annoyance to developers, but it provides more accurate reporting and saves the time required to go back and correct the work items in the future.

blog comments powered by Disqus

KodefuGuru.GetInfo()

Chris Eargle
LinkedIn Twitter Technorati Facebook

Chris Eargle
Telerik Developer Evangelist, C# MVP

JustCode

Telerik .NET Ninja

 

INETA Community Speakers Program

 

MVP - Visual C#

 

Friend of RedGate

World Map

Month List

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2010
Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer’s view in any way.