我使用来自Microsoft的查询示例:
https://analytics.dev.azure.com/{OrganizationName}/{ProjectName}/_odata/{version}//WorkItems ?选择美元= WorkItemId,标题,WorkItemType, State&过滤器= WorkItemId % 20 eq % 20103美元,美元扩大=链接($选择= SourceWorkItemId TargetWorkItemId LinkTypeName;扩大= TargetWorkItem美元($选择= WorkItemId、标题、状态))
我的值
结果如下
{
"@odata.context": "https://analytics.dev.azure.com/{OrganizationName}/{ProjectName}/_odata/{version}//$metadata#WorkItems(WorkItemId,Title,WorkItemType,State,Links(SourceWorkItemId,TargetWorkItemId,LinkTypeName,TargetWorkItem(WorkItemId,Title,State)))",
"value": [{
"WorkItemId": 103,
"Title": "Feature Y",
"WorkItemType": "Feature",
"State": "New",
"Links": [{
"SourceWorkItemId": 103,
"TargetWorkItemId": 48,
"LinkTypeName": "Child",
"TargetWorkItem": {
"WorkItemId": 48,
"Title": "Story 15",
"State": "Resolved"
}
}, {
"SourceWorkItemId": 103,
"TargetWorkItemId": 50,
"LinkTypeName": "Child",
"TargetWorkItem": {
"WorkItemId": 50,
"Title": "Story 17",
"State": "Active"
}
我想检索TargetWorkItem(不是TargetSourceItem)的AreaPath:我应该如何修改我的查询?
谢谢!!
我想检索TargetWorkItem(不是TargetSourceItem)的AreaPath:我应该如何修改我的查询?
对于每个带有直接链接示例报告的工作项,您可以尝试从文档中获取以下OData查询片段:
https://analytics.dev.azure.com/{organization}/{project}/_odata/v3.0-preview/WorkItems?
$filter=WorkItemType eq 'User Story'
and State ne 'Closed'
and startswith(Area/AreaPath,'{areapath}')
&$select=WorkItemId,Title,WorkItemType,State,Priority,Severity,TagNames,AreaSK
&$expand=AssignedTo($select=UserName),Iteration($select=IterationPath),Area($select=AreaPath),
Links(
$filter=LinkTypeName eq 'Related'
and TargetWorkItem/WorkItemType eq 'User Story';
$select=LinkTypeName;
$expand=TargetWorkItem($select=WorkItemType,WorkItemId,Title,State)
)