Rolling Up Status on Work Items

Say you have a work item type (WIT) that represent a big task, like a Feature, then you have individual Task work items that make up that feature.  You want to update the work completed and remaining of the tasks, and have that roll into the corrosponding feature.

Today TFS doesn't support work item heiarchy or rolling up values from across work items.  My own team uses Tasks with Remaining Work and Completed Work fields that are suppose to be manually copied into a parent Feature work item (with the same fields).  We then do reporting of off the Feature work items.  It has been a real pain manually calculating all the numbers and making sure they're up to date.

So I've created this little tool that does this for us.  It sums up the values of fields in child work items and puts the sum into the parent's field.  It is currently relatively simple in that it only supports a two-level heiarchy (not a full tree), starts from the bottom up, and sums double fields.  But I've included the source code so you can make changes as you see fit.  Occationally I'll post updates too.

Project & Source Code: RollupStatus.zip

Setup

It is relatively straight forward to set up...

  • First you need to represent a hiearchy in your work items types.  The easiest to do by adding a "ParentID" field to a work item type which you would populate with the parent's ID.
  • Create a query that returns all the children you want rolled up.
  • Customize the command XML to represent your fields, query, server, project, etc
  • Run the app with the command XML to test it out
  • Schedule a task to run the app regularly.

Improvement Ideas

There are a bunch more things an app like this could do, here are some things that pop to mind.

  • Support parent & child WITs with different fields
  • Support other forms of work item heiarchies (see this post)
  • Support using a query of parent items instead of just children
  • Support an n-depth tree of work items.  It was created only for
  • Support other types of sums or groups (other than a double field), such as percentage of state "Completed"
  • Make it work amoung multiple TFS servers