TFS - how do I sum child task hours to parent

2019-07-19 10:56发布

问题:

TFS Web-client provides a "board" view under the backlog tab which shows the sum of Remaining work for a User Story based on the Sum of Remaining Work for it's child tasks.

I have also tried exporting to Excel and using a Pivot table, but there are no obvious links between the work items (as far as I can tell).

I saw this question but I can't tell if that is the same idea.

Also, this item might be similar, but no responses were received yet.

Can it be done out-of-the-box in Visual Studio TFS?

Does it require coding?

Are there plugins available? I've looked at TFSAggregator on Github and that might work but I'd like to avoid server-side plugins if possible.

回答1:

One of the many uses of TFS Aggregator... it is even one of their sample use cases!

Example Uses

  • Update the state of a Bug, PBI (or any parent) to "In Progress" when a child gets moved to "In Progress"
  • Update the state of a Bug, PBI (or any parent) to "Done" when all children get moved to "Done" or "Removed"
  • Update the "Work Remaining" on a Bug, PBI, etc with the sum of all the Task's "Work Remaining".
  • Update the "Work Remaining" on a Sprint with the sum of all the "Work Remaining" of its grandchildren (i.e. tasks of the PBIs and Bugs in the Sprint).
  • Sum up totals on a single work item (i.e. Dev Estimate + Test Estimate = Total Estimate)


回答2:

You can rollup estimated and actual work using Project. Because Microsoft Project has a scheduling engine, it automatically will generate a rollup of summary tasks. Rollup provides summed values of select fields for all child work items of a parent. https://msdn.microsoft.com/en-us/library/dn769080(v=vs.140).aspx



回答3:

I've been able to do this, however there is an issue when a Task's State value is set to "Removed", the rollup values should not be calculated for that Task. In the policy file, I've got the if condition like so:

    <rule name="RollupTasks" appliesTo="Task"><![CDATA[
    string wfState = (string) self.Fields["State"].Value;
    if (wfState="Removed" && self.HasParent()) ...

But that didn't work. I've also tried:

    <rule name="RollupTasks" appliesTo="Task"><![CDATA[
    if (self.HasParent() && self[System.State]="Removed") ...

..but this doesn't seem to work. Am I close?