gpt4 book ai didi

c# - WIQL : How to get the content of a field of a work item returned by a query

转载 作者:行者123 更新时间:2023-11-30 21:08:59 25 4
gpt4 key购买 nike

我必须获取单个工作项中字段的值。该查询仅返回一个工作项,因为在我的 where 子句中我明确指定了我想要的工作项 ID。这是一种 GetFieldByWorkItemId 方法:

public double GetOriginalEstimate(object id)
{
WorkItemCollection queryResults = workItemStore.Query(
" SELECT [Original Estimate]" +
" FROM WorkItems " +
" WHERE [ID] = " + Convert.ToInt32(id)
);

return 0;
}

我的两个问题是:

  1. 如何通过 Id 从 WorkItemCollection queryResults 中获取工作项
  2. 如何获取我感兴趣的字段的值:[Original Estimate]

最佳答案

无需运行查询,您可以 retrieve a single work item通过它的 ID:

WorkItemStore.GetWorkItem(int id)["Original Estimate"]

关于c# - WIQL : How to get the content of a field of a work item returned by a query,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9284633/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com