Reputation: 4445
I have to obtain the value of a field in a single work item. The query only returns one work item, because in my where clause I specify exaclty which Work Item Id I want. It's sort of a GetFieldByWorkItemId
kind of method:
public double GetOriginalEstimate(object id)
{
WorkItemCollection queryResults = workItemStore.Query(
" SELECT [Original Estimate]" +
" FROM WorkItems " +
" WHERE [ID] = " + Convert.ToInt32(id)
);
return 0;
}
My two questions are:
WorkItemCollection
queryResults by Id[Original Estimate]
Upvotes: 2
Views: 2481
Reputation: 8939
Rather than run a query, you can retrieve a single work item by it's ID:
WorkItemStore.GetWorkItem(int id)["Original Estimate"]
Upvotes: 4