[英]Unable to link changeset to work item with TFS API
我想創建一個工作項,並使用Azure DevOps Services(和TFS) (新API)的.NET客戶端庫在C#中將變更集鏈接到他。
我成功創建了一個工作項,但是如果我也嘗試鏈接變更集,則會出錯。
我的代碼:
// After add title etc.
json.Add(
new JsonPatchOperation()
{
Operation = Operation.Add,
Path = "/relations/-",
Value = new
{
rel = "ArtifactLink",
url = {changesetUrl},
attributes = new
{
name = "Fixed in Changeset"
}
}
});
// then I create the work item with CreateWorkItemAsync(json, teamProject, "Task")
例外:
無效的資源鏈接目標:“ http // tfsServer:8080 / tfs / collection / _apis / tfvc / changesets / {changesetID}”
我究竟做錯了什么?
好的,我設法弄清楚問題出在哪里。
在url = {changesetUrl},
我在變量中傳遞了changeset url( 'http//tfsServer:8080/tfs/collection/_apis/tfvc/changesets/{changesetID}
),此url不是此api的正確url呼叫。
正確的網址是: vstfs:///VersionControl/Changeset/{changesetID}
。
更改網址后,它開始工作,並使用鏈接創建了工作項。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.