3
votes

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?

- Mayur

1

1 Answers

2
votes

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.