當試圖更新使用調用-RestMethod現有VSTS工作項目,我不斷收到什麼是正確的調用,RestMethod語法來更新VSTS工作項目在PowerShell中 - 構建包含Windows路徑
JSON字符串您必須在請求的正文中傳遞有效的補丁文檔。
這裏是我傳遞
$Body = '[{ "op": "test", "path": "/rev", "value": 1},{ "op": "add", "path": "/fields/System.IterationPath", "value":"' + $caseIterationPath + '"},{ "op": "add", "path": "/fields/System.AreaPath", "value":"' + $caseAreaPath + '"}]'
Invoke-RestMethod -Uri "$rootUri/_apis/wit/workitems/$($case.id)?$apiVersion" -Method PATCH -ContentType application/json-patch+json -Headers @{Authorization= $authorization} -Body $Body
體膨脹到
"[{ "op": "test", "path": "/rev", "value": 1},{ "op": "add", "path": "/fields/System.IterationPath", "value":"Foo\Bar 2016.4\2016.4.02"},{ "op": "add", "path": "/fields/System.AreaPath", "value":"Foo\Apps\Bar Stool\Eating"}]"
任何幫助將不勝感激!
謝謝!這是一個很大的幫助。 –