如何从 Azure DevOps Services REST API 获取可用区域路径?
How do you get available Area Paths from Azure DevOps Services REST API?
我找不到如何从 API 检索区域路径。我能够到达迭代路径但不能到达区域路径。
我在技术上使用 c# 包装器
我试过
- ProjectHttpClient.GetProject()
- ProjectHttpClient.GetProjectPropertiesAsync();
- WorkItemTrackingHttpClient.GetFieldAsync("System.AreaPath");
- WorkItemTrackingHttpClient.GetWorkItemTypeFieldWithReferencesAsync();
- 自从我从那里获得迭代后,我也查看了 WorkHttpClient。
- 我查看了文档,但找不到任何内容。即使搜索 "area" 也没有任何结果。
这是您正在寻找的 API 个电话:
GET https://dev.azure.com/{organization}/{project}/_apis/wit/classificationnodes?$depth={$depth}&api-version=5.0
这将为您提供根节点及其 children,之后您可以查询单个 children,我得到的 child 示例:
id : 32
identifier : GUID
name : childname
structureType : area
hasChildren : False
path : \parent\Area\childname
url : https://dev.azure.com/xxx/yyy/_apis/wit/classificationNodes/Are
as/childname
C#API:
_destinationTfs = new VssConnection(new Uri(TfsUri), new VssBasicCredential(string.Empty, AccessToken));
_witClient = _destinationTfs.GetClient<WorkItemTrackingHttpClient>();
var areaPathNode = await _witClient.GetClassificationNodeAsync("PROJECT_NAME", TreeStructureGroup.Areas, depth: 1);
// areaPathNode.Children will contain all your area paths.
ps。它非常好地隐藏在 API 文档
中
我找不到如何从 API 检索区域路径。我能够到达迭代路径但不能到达区域路径。
我在技术上使用 c# 包装器
我试过
- ProjectHttpClient.GetProject()
- ProjectHttpClient.GetProjectPropertiesAsync();
- WorkItemTrackingHttpClient.GetFieldAsync("System.AreaPath");
- WorkItemTrackingHttpClient.GetWorkItemTypeFieldWithReferencesAsync();
- 自从我从那里获得迭代后,我也查看了 WorkHttpClient。
- 我查看了文档,但找不到任何内容。即使搜索 "area" 也没有任何结果。
这是您正在寻找的 API 个电话:
GET https://dev.azure.com/{organization}/{project}/_apis/wit/classificationnodes?$depth={$depth}&api-version=5.0
这将为您提供根节点及其 children,之后您可以查询单个 children,我得到的 child 示例:
id : 32
identifier : GUID
name : childname
structureType : area
hasChildren : False
path : \parent\Area\childname
url : https://dev.azure.com/xxx/yyy/_apis/wit/classificationNodes/Are
as/childname
C#API:
_destinationTfs = new VssConnection(new Uri(TfsUri), new VssBasicCredential(string.Empty, AccessToken));
_witClient = _destinationTfs.GetClient<WorkItemTrackingHttpClient>();
var areaPathNode = await _witClient.GetClassificationNodeAsync("PROJECT_NAME", TreeStructureGroup.Areas, depth: 1);
// areaPathNode.Children will contain all your area paths.
ps。它非常好地隐藏在 API 文档
中