[英]Azure DevOps API error: Field state 'Active' not supported when Work Item has been "Removed"
I have a work item of type feature with a state of "Removed."我有一个类型为“已删除”的 state 特征的工作项。 When trying to update the field state back to "Active" on certain conditions, I'm getting the following error:
在某些情况下尝试将字段 state 更新回“活动”时,出现以下错误:
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
Note that my code works updating field.'System.State' in all cases except when it's trying to change a "removed" work item.请注意,我的代码在所有情况下都可以更新 field.'System.State' ,除非它试图更改“已删除”的工作项。 Is there a special way to do this?
有没有特殊的方法可以做到这一点?
Is there a special way to do this?
有没有特殊的方法可以做到这一点?
I am afraid there is no such way to do this.恐怕没有这样的方法可以做到这一点。
That is because the workitem that is already in the Removed
state cannot be converted to other states except New
.那是因为已经在
Removed
state 中的工作项无法转换为除New
之外的其他状态。
You could check the document Agile workflow states for some more details.您可以查看文档敏捷工作流状态以获取更多详细信息。
In addition, when we have chosen to Remove
a certain workitem, it means that we have abandoned the workitem.另外,当我们选择
Remove
某个工作项时,就意味着我们已经放弃了该工作项。 If the workitem is re-enabled, it should return to the state of New
.如果工作项被重新启用,它应该返回到
New
的 state。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.