Arkady Spiridonov
Arkady Spiridonov

Reputation: 150

How to get total time for workitem?

I have this code, it must print total time of completed tasks.

WorkItemStore Store = (WorkItemStore)Tfs.GetService(typeof(WorkItemStore));
var query = Store.Query(q.Replace("@project", "'" + ProjInfo.Name + "'").Replace("@Me", "'" + Environment.UserName + "'"));
for (int i = 0; i < query.Count; i++)
    {
        Console.WriteLine(query[i][Total Work]);
    }

But I cannot find any field about time for completed task. Please, show the right path. :)

Upvotes: 0

Views: 500

Answers (1)

You need to find the fields that you want to sum in TFS and this depends on the process template.

  • MSF Templates - Remaining Work | Completed Work | Original Estimate
  • Scrum Template - Remaining Work

I think that you will need to sum Completed Work however this is dysfunctional behavior and I would query the validity of your metric.

Upvotes: 1

Related Questions