我已经创建了VSTS
使用 Rest API 的场景和任务。现在我正在尝试使用 Rest API 将任务链接到该特定场景。我已经看到了一些他们正在使用的代码逻辑,System.LinkTypes.Hierarchy-Forward
但我不确定如何在我的代码中适应它。有人可以帮我吗?
我已经使用JsonPatchDocument
方法创建了任务和场景。
我已经创建了VSTS
使用 Rest API 的场景和任务。现在我正在尝试使用 Rest API 将任务链接到该特定场景。我已经看到了一些他们正在使用的代码逻辑,System.LinkTypes.Hierarchy-Forward
但我不确定如何在我的代码中适应它。有人可以帮我吗?
我已经使用JsonPatchDocument
方法创建了任务和场景。
刚刚找到了问题的答案:
document.Add(
new JsonPatchOperation()
{
Path = "/relations/-",
Operation = Microsoft.VisualStudio.Services.WebApi.Patch.Operation.Add,
Value = new
{
rel = "System.LinkTypes.Hierarchy-Reverse",
url = collectionUri + "/_apis/wit/workItems/" + porWorkItemID.ToString(),
attributes = new
{
comment = "Making a new link for the dependency"
}
}
});