How to change System.State field in TFS?

2019-07-06 20:02发布

I have the requirement where I do need to change the System.State field of workitem when other field gets changed. I know tfs workflow is state based i.e. depending upon state you can change values of other field. But how to go other way round?

Thanks in advance!

  • Mayur

标签: tfs2010
1条回答
神经病院院长
2楼-- · 2019-07-06 20:37

I don't think you can achieve that by using the built-in work item workflow. That's due to the fact that one must use the <COPY> rule in order to set the value of a field. However, you can't use <COPY> with the System.State field. Trying to do so results in the following error:

TF26062: Rule '<COPY from="value" value="Active" />' is not supported for the field 'System.State'.

That leaves you with two options:

  1. Create a custom control. It has the advantage of immediate feedback, but can be very expensive to develop - especially if you can to support WinForms (Visual Studio), Web (Team Web Access) and Java (Eclipse + TEE);
  2. Handle it from the server side, monitoring the WorkItemChanged event. The downside is that it doesn't reflect immediately in the end-user screen. After editing a work item, the user would have to hit Refresh to see the new state.
查看更多
登录 后发表回答