Work item state fields
-
Friday, February 08, 2008 8:20 AM
Hi,
I am using the process template editor to change the state-transition diagram of a workitem (TFS 2005).
I have 2 questions:
1. Is the following statement right: By changing the fields in an transition reason it's possible to control what fields in the workitem get an altered value (<WORKITEMTYPE><WORKFLOW><TRANSITIONS><TRANSITION><FIELDS><FIELD> element ).
2. Wherefore are the FIELDS in the <WORKITEMTYPE><WORKFLOW><STATES><STATE><FIELDS> element?
Unfortunatly the help doesn't help me (http://msdn2.microsoft.com/en-us/library/aa337669.aspx).
Looking at the current contents doesn't help me eighter. For example, the 'Active' state has a field 'Resolved date' and 'Closed date'
Thanks for your help,
Perry
All Replies
-
Tuesday, February 12, 2008 11:05 AM
Hi Perry,
Yes, you can define rules that constrain field values in four ways.
A rule can apply to a particular field -
-
While the work item is in a specific state.
-
When the work item makes a specific transition.
-
When the work item makes a specific transition for a specific reason.
In each case, the set of field rules you can use is more or less the same.
You can also make the rule conditional on the values of another field.
You can also make a rule apply or not apply to a particular user or user group using the FOR and NOT clauses.
Some rules just constrain what the user can put into the field: for example, ALLOWEDVALUES provides an enumerated list of values, and REQUIRED prevents the user from saving the work item without providing a value.
Other rules actually put a value into the field. For example, EMPTY forces the field to be empty, and COPY is used to copy a value from one field to another. In the MSF Agile "Bug" work item type, in the transition from Active to Resolved, the AssignedTo field is copied from the System.CreatedBy field - so that by default, the bug is reassigned to its original creator for review. COPY only provides a limited set of values you can use - the value of another field, the current user, the current time, or a literal value. It doesn't let you compute any functions. But sometimes you can work around that limitation by making several different conditional rules.
So to answer your questions,
1. Yes, within a limited range of possibilities, you can set values into a field when the work item makes a transition; or when it makes a transition for a particular reason.
2. <STATE><FIELDS> is used for rules that govern the value of a field when the work item is in a particular state. So for example, while the work item is Closed, you might want to fix the Remaining Work field to zero. If you put that rule in the Closed State, it will prevent users from changing the field from zero unless they re-activate the work item. Alternatively, if you put it in all the transitions to Closed, it will set the value when the state is first set to Closed, but allow users to change it later.
Hope this is useful.
-
Tuesday, February 12, 2008 11:58 AM
Alan Cameron Wills -MSFT wrote: Hi Perry,
Yes, you can define rules that constrain field values in four ways.
A rule can apply to a particular field -
-
While the work item is in a specific state.
-
When the work item makes a specific transition.
-
When the work item makes a specific transition for a specific reason.
In each case, the set of field rules you can use is more or less the same.
You can also make the rule conditional on the values of another field.
You can also make a rule apply or not apply to a particular user or user group using the FOR and NOT clauses.
Some rules just constrain what the user can put into the field: for example, ALLOWEDVALUES provides an enumerated list of values, and REQUIRED prevents the user from saving the work item without providing a value.
Other rules actually put a value into the field. For example, EMPTY forces the field to be empty, and COPY is used to copy a value from one field to another. In the MSF Agile "Bug" work item type, in the transition from Active to Resolved, the AssignedTo field is copied from the System.CreatedBy field - so that by default, the bug is reassigned to its original creator for review. COPY only provides a limited set of values you can use - the value of another field, the current user, the current time, or a literal value. It doesn't let you compute any functions. But sometimes you can work around that limitation by making several different conditional rules.
So to answer your questions,
1. Yes, within a limited range of possibilities, you can set values into a field when the work item makes a transition; or when it makes a transition for a particular reason.
2. <STATE><FIELDS> is used for rules that govern the value of a field when the work item is in a particular state. So for example, while the work item is Closed, you might want to fix the Remaining Work field to zero. If you put that rule in the Closed State, it will prevent users from changing the field from zero unless they re-activate the work item. Alternatively, if you put it in all the transitions to Closed, it will set the value when the state is first set to Closed, but allow users to change it later.
Hope this is useful.
Hi Alan,
This makes things clear for me.
I thought I was applying values in stead of rules.
Once you start thinking the wrong way, it's hard to put the mind open for other possible meanings of a field.
Applying rules make sense.
Thanks for your input.
Perry
-
Thursday, February 28, 2008 5:38 PM
How to get States & Transistions for all the Work Item Fields in an WorkItemType of a particular Team Project?
Do we have some TFS API stuff for that & also is it possible to get that information in the form of some xml document?
Thanks in advance.
-
Friday, February 29, 2008 7:19 AMAre u using the process template editor (http://msdn2.microsoft.com/en-us/teamsystem/aa718351.aspx)?
-
Friday, February 29, 2008 3:59 PM
Ya. I am using Customised Process Template for Project.
I need to use these existing States & Transistion information from TFS for building the .net web application, which interacts with TFS to create work item and uses the buitin Workflow of that project in TFS.
Any ideas?
bthway thnks for the Power Tool Link..
-
Monday, March 03, 2008 8:32 AM
Sagar Gandewar wrote: Ya. I am using Customised Process Template for Project.
I need to use these existing States & Transistion information from TFS for building the .net web application, which interacts with TFS to create work item and uses the buitin Workflow of that project in TFS.
Any ideas?
bthway thnks for the Power Tool Link..
The process template edit is/was an open source proejct, so dig up the source code and see how they did it.
-
Wednesday, August 01, 2012 12:49 PM
Hello Mr.Wills
In tfs Work item...
i want to add values in system.state so i open WORK item Field Explorer...but when i open it, its open in disable i cant edit in system.state Collection i want to add some more values in System.State collection
How can i add in that ..plz tell me
Thnaks & Regards, Pramod Tiwari
-
Wednesday, September 05, 2012 10:31 AMThis is usful for me

