如何使用Rest API了解我的VSTS workItems中组的确切名称。 我知道字段名称但是我不知道组名称或如何访问组。我无法将字段添加到组
答案 0 :(得分:0)
要获取组名,可以使用REST API到get process definition's Layout:
GET https://{accountName}.visualstudio.com/_apis/work/processdefinitions/{processId}/workItemTypes/{witRefName}/layout?api-version=4.1-preview
如
GET https://marinaliu.visualstudio.com/_apis/work/processdefinitions/c3c605d0-4ea8-492a-9d26-46612ccb51b1/workItemTypes/Microsoft.VSTS.WorkItemTypes.Bug/layout?api-version=4.1-preview
响应如下:
{
"pages": [
{
"id": "Scrum.Bug.Bug",
"inherited": true,
"label": "Details",
"pageType": "custom",
"locked": false,
"visible": true,
"isContribution": false,
"sections": [
{
"id": "Section1",
"groups": [
...
{
"id": "2fe29062-685e-4e36-89ba-6415becaebd7",
"label": "Group1",
"isContribution": false,
"visible": true,
"controls": [
{
"id": "8c6bc312-cd08-44a7-a403-5bcbbe9baff1",
"label": "control",
"readOnly": false,
"visible": true,
"contribution": {
"contributionId": "ms-devlabs.vsts-extensions-multivalue-control.multivalue-form-control",
"inputs": {
"FieldName": "Microsoft.VSTS.Common.Activity",
"Values": "control value"
}
},
"isContribution": true
}
]
}
]
}
...
}
您可以从sections
和groups
个对象下的label参数中获取组名称。