我有一個狀態為“已洗掉”的功能型別的作業項。在某些條件下嘗試將欄位狀態更新回“活動”時,我收到以下錯誤:
resp = Invoke-RestMethod -Uri $updateUri -Method Patch -ContentType application/json-patch json -Headers $header -Body $jsonBody
Invoke-RestMethod : {"$id":"1","customProperties":{"FieldReferenceName":null,"FieldStatusFlags":"none","ErrorMessage":"The field 'State' contains the value 'Active' that is not in
the list of supported values","FieldStatusCode":0,"RuleValidationErrors":[{"fieldReferenceName":"System.State","fieldStatusFlags":"required, hasValues, limitedToValues,
invalidListValue","errorMessage":"The field 'State' contains the value 'Active' that is not in the list of supported
values","fieldStatusCode":4194317,"ruleValidationErrors":null}]},"innerException":null,"message":"The field 'State' contains the value 'Active' that is not in the list of supported
values","typeName":"Microsoft.TeamFoundation.WorkItemTracking.Server.RuleValidationException,
Microsoft.TeamFoundation.WorkItemTracking.Server","typeKey":"RuleValidationException","errorCode":0,"eventId":3200}
At line:1 char:9
$resp = Invoke-RestMethod -Uri $updateUri -Method Patch -ContentType ...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
請注意,我的代碼在所有情況下都可以更新 field.'System.State',除非它試圖更改“已洗掉”的作業項。有沒有特殊的方法可以做到這一點?
uj5u.com熱心網友回復:
有沒有特殊的方法可以做到這一點?
恐怕沒有這樣的方法可以做到這一點。
那是因為已經處于該Removed狀態的作業項無法轉換為除 之外的其他狀態New。
您可以查看檔案
此外,當我們選擇Remove了某個作業項時,就意味著我們已經放棄了該作業項。如果作業項重新啟用,它應該回傳到 的狀態New。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/426232.html
