1

我已经创建了VSTS使用 Rest API 的场景和任务。现在我正在尝试使用 Rest API 将任务链接到该特定场景。我已经看到了一些他们正在使用的代码逻辑,System.LinkTypes.Hierarchy-Forward但我不确定如何在我的代码中适应它。有人可以帮我吗?

我已经使用JsonPatchDocument方法创建了任务和场景。

4

1 回答 1

1

刚刚找到了问题的答案:

                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"
                        }
                    }
                    });
于 2017-02-03T06:46:48.660 回答