gpt4 book ai didi

c# - 如何通过 C# 代码查找 WIQL TFS Workitem 中所有字段的值?

转载 作者:行者123 更新时间:2023-11-30 23:04:55 25 4
gpt4 key购买 nike

如何找到字段的所有值,例如完成状态、工作项类型和状态附上图片。
工作项类型字段及其值
enter image description here
状态字段及其所有值

enter image description here
完成状态及其值
enter image description here

最佳答案

是的,您可以使用客户端 API 通过获取类 FieldDefinition 的实例并引用 AllowedValues 属性来获取允许值。

FieldDefinition.AllowedValues Property

供您引用的示例代码。

var tfs = TeamFoundationServerFactory.GetServer("http://vstspioneer:8080/tfs/VSTSDF");
var workItemStore = (WorkItemStore)tfs.GetService(typeof(WorkItemStore));
var allowedValues = workItemStore.FieldDefinitions[xxx.xxx].AllowedValues;

foreach (String value in allowedValues)
{
Console.WriteLine(value);
}

完成状态不是内置字段,应该是自定义字段。

更多详情请引用此博客:Get List of Allowed Values in TFS Work Item Field

关于c# - 如何通过 C# 代码查找 WIQL TFS Workitem 中所有字段的值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49105756/

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