我需要使用 TFS 2015 REST API 获取特定工作项类型的字段(不在全局列表中)的允许值列表。我知道我可以使用 Get a work item field 获取有关字段的信息但这似乎并没有给我响应中允许的值。
{
"name": "Iteration Path",
"referenceName": "System.IterationPath",
"type": "treePath",
"readOnly": true,
"supportedOperations": [
{
"referenceName": "SupportedOperations.Under",
"name": "Under"
},
{
"referenceName": "SupportedOperations.NotUnder",
"name": "Not Under"
},
{
"referenceName": "SupportedOperations.Equals",
"name": "="
},
{
"referenceName": "SupportedOperations.NotEquals",
"name": "<>"
},
{
"referenceName": "SupportedOperations.In",
"name": "In"
}
],
"url": "https://fabrikam-fiber-inc.visualstudio.com/DefaultCollection/_apis/wit/fields/System.IterationPath"
}
看起来像someone on the MSDN forums posted this回到 6 月,但我想仔细检查一下这是否仍然是不可用的。
最佳答案
REST API 仍然不支持获取字段中的允许值。下面的网站已经有此功能的 UserVoice,您可以投票:
目前,您只能使用旧的 .net API 通过获取类 FieldDefinition 的实例并引用 AllowedValues 属性来获取允许值。
关于c# - TFS REST API - 获取字段的允许值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40365899/