【发布时间】:2020-06-06 11:31:49
【问题描述】:
我正在尝试通过 AZDO REST Api 将 Azure DevOps 流程从一个组织复制到另一个组织。我正在复制布局,但由于在查询源 AZDO 实例时无法发现自定义字段和选项列表之间的关系,所以我卡住了。
在我的场景中,我有一个称为问题的测试工作项类型。在问题界面上,我创建了一个自定义字段,它是一个选项列表。虽然我可以通过 Rest API retrieve a list of lists 和 examine the field 进行操作,但我无法弄清楚两者之间的关系。
这是部分有效载荷from the field:
{
"count": 39,
"value": [
...
{
"referenceName": "Custom.IssueSource",
"name": "Issue Source",
"type": "string",
"description": "Who is this attributed to",
"required": true,
"url": "https://dev.azure.com/MYORG/_apis/work/processes/f390103e-7097-4f19-b5b5-f9dbcf92bb6f/behaviors",
"customization": "custom"
},
... ]
}
这是来自lists get query 的部分有效负载,我通过反复试验确定是我分配的选项列表:
{
"count": 10,
"value": [
...
{
"id": "2998d4e4-2bec-4935-98a1-b67a0b0b6d5d",
"name": "picklist_e854661e-8620-4ad9-be28-b974c5cb3a5d",
"type": "String",
"isSuggested": false,
"url": "https://dev.azure.com/MYORG/_apis/work/processes/lists/2998d4e4-2bec-4935-98a1-b67a0b0b6d5d"
},
...
]
}
这是 WIT 的部分layout response:
{
"pages": [
{
"id": "d0171d51-ff84-4038-afc1-8800ab613160.System.WorkItemType.Details",
"inherited": true,
"label": "Details",
"pageType": "custom",
"visible": true,
"isContribution": false,
"sections": [
{
"id": "Section1",
"groups": [
...
{
"id": "bf03e049-5062-4d82-b91d-4396541fbed2",
"label": "Custom",
"isContribution": false,
"visible": true,
"controls": [
{
"id": "Custom.IssueSource",
"label": "Issue Source",
"controlType": "FieldControl",
"readOnly": false,
"visible": true,
"isContribution": false
}
]
}
]
},
... ]
}
对 AZDO Web 界面使用提琴手,我唯一看到对选择列表的引用是从另一个非 AZDO API 到 https://dev.azure.com/MYORG/_apis/Contribution/dataProviders/query
有没有办法通过 AZDO Rest API 发现链接?我看到了this question which was similar but was about creating the link
【问题讨论】:
标签: rest azure-devops