如何更改 TFS 中的 System.State 字段? [英] How to change System.State field in TFS?
问题描述
我有一个要求,当其他字段更改时,我确实需要更改 workitem
的 System.State
字段.我知道 TFS 工作流是基于状态的,即根据状态您可以更改其他字段的值.但如何走另一条路?
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 the state you can change values of other fields. But how to go another way around?
- 马约尔
推荐答案
我认为您无法通过使用内置工作项工作流来实现这一目标.这是因为必须使用 <COPY> 规则来设置字段的值.但是,您不能将
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:不支持规则 '<COPY from="value" value="Active"/>'对于System.State"字段.
TF26062: Rule '<COPY from="value" value="Active" />' is not supported for the field 'System.State'.
这给您留下了两个选择:
That leaves you with two options:
- 创建自定义控件.它具有即时反馈的优势,但开发成本可能非常高 - 特别是如果您可以支持 WinForms (Visual Studio)、Web (Team Web Access) 和 Java (Eclipse + TEE);
- 从服务器端处理它,监控 WorkItemChanged 事件.缺点是它不会立即反映在最终用户屏幕中.编辑工作项后,用户必须点击刷新才能查看新状态.
这篇关于如何更改 TFS 中的 System.State 字段?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!