gpt4 book ai didi

azure-devops - 查询只返回工作项列表的 ID 和 URL 不返回标题

转载 作者:行者123 更新时间:2023-12-05 06:44:20 25 4
gpt4 key购买 nike

我正在使用 VSO(Visual Studio Online API),我正在使用这个查询:

{
"name": "All Workitems",
"wiql": "Select [System.Id], [System.Title], [System.State] From WorkItems order by [Microsoft.VSTS.Common.Priority] asc, [System.CreatedDate] desc"
}

嗯,我期待一个带有 ID 标题及其状态的工作项列表,但作为响应,我只得到它的 ID 和 URL。我应该使用什么查询?

响应:

{
"queryType": "flat",
"queryResultType": "workItem",
"asOf": "2015-04-18T05:23:05.353Z",
"columns": [
{
"referenceName": "System.Id",
"name": "ID",
"url": "https://sami1212.visualstudio.com/DefaultCollection/_apis/wit/fields/System.Id"
},
{
"referenceName": "System.Title",
"name": "Title",
"url": "https://sami1212.visualstudio.com/DefaultCollection/_apis/wit/fields/System.Title"
},
{
"referenceName": "System.State",
"name": "State",
"url": "https://sami1212.visualstudio.com/DefaultCollection/_apis/wit/fields/System.State"
}
],
"sortColumns": [
{
"field": {
"referenceName": "Microsoft.VSTS.Common.Priority",
"name": "Priority",
"url": "https://sami1212.visualstudio.com/DefaultCollection/_apis/wit/fields/Microsoft.VSTS.Common.Priority"
},
"descending": false
},
{
"field": {
"referenceName": "System.CreatedDate",
"name": "Created Date",
"url": "https://sami1212.visualstudio.com/DefaultCollection/_apis/wit/fields/System.CreatedDate"
},
"descending": true
}
],
"workItems": [
{
"id": 7,
"url": "https://sami1212.visualstudio.com/DefaultCollection/_apis/wit/workItems/7"
},
{
"id": 6,
"url": "https://sami1212.visualstudio.com/DefaultCollection/_apis/wit/workItems/6"
},
{
"id": 5,
"url": "https://sami1212.visualstudio.com/DefaultCollection/_apis/wit/workItems/5"
},
{
"id": 4,
"url": "https://sami1212.visualstudio.com/DefaultCollection/_apis/wit/workItems/4"
},
{
"id": 3,
"url": "https://sami1212.visualstudio.com/DefaultCollection/_apis/wit/workItems/3"
},
{
"id": 2,
"url": "https://sami1212.visualstudio.com/DefaultCollection/_apis/wit/workItems/2"
},
{
"id": 1,
"url": "https://sami1212.visualstudio.com/DefaultCollection/_apis/wit/workItems/1"
}
]
}

最佳答案

从工作项中选择 [system.id]

然后当我得到结果时,我从正文中提取了所有 id -> 字段 -> {id, url} [list]

使用指定的 ID 列表,我已将 ID 列表发送到列表工作项端点

/workitems?ids=1,2, ... 并且您应该获得所有工作项的所有字段的结果..

有趣的是,我们还可以在查询所有工作项时传递 where in (ids, ids2 ..) 子句。传入fields查询参数来过滤字段

关于azure-devops - 查询只返回工作项列表的 ID 和 URL 不返回标题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29713468/

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