Limit Assignedto users depending on state.  
Author Message
paso





PostPosted: Team Foundation Server - Work Item Tracking, Limit Assignedto users depending on state. Top

I want to limit the AssignedTo-field to a specific list of users, depending on the state, so I defined following xml

<STATE value="Tested" >
<FIELDS>
<FIELD refname="System.AssignedTo" >
<REQUIRED />
<ALLOWEDVALUES expanditems="true" filteritems="excludegroups">
<LISTITEM value="[Project]\QA" />
</ALLOWEDVALUES>
</FIELD>
</FIELDS>
</STATE>

However when I change the state to "Tested", the current value of AssignedTo is also in the dropdown list while this user is not a member of the 'QA" group.
I can even save the work item with this value.
Any ideas

Thanks.



Visual Studio Team System20  
 
 
Smitha S Saligrama





PostPosted: Team Foundation Server - Work Item Tracking, Limit Assignedto users depending on state. Top

Hello,

You may have a transition rule which may put the current value to assigned to drop down list.

Can you please provide the your whole Work item xml.

Thanks,



 
 
paso





PostPosted: Team Foundation Server - Work Item Tracking, Limit Assignedto users depending on state. Top

I would rather not publish my work item definition. I searched the complete file and could only find following references to System.AssignedTo:
- field definition

      <FIELD name="Assigned To" refname="System.AssignedTo" type="String" reportable="dimension">
        <ALLOWEXISTINGVALUE/>
        <REQUIRED />
        <ALLOWEDVALUES expanditems="true" filteritems="excludegroups" >
          <LISTITEM value="[Project]\Contributors" />
        </ALLOWEDVALUES>
      </FIELD>


- in Tested-state (code fragment in thread)
- in form definition

 


 
 
paso





PostPosted: Team Foundation Server - Work Item Tracking, Limit Assignedto users depending on state. Top

I found my problem. I had an "ALLOWEXISTINGVALUE" rule added to the System.AssignedTo field.
I had the same problem with a dependent pick list, where the possible values of field2 are dependent on the value of field1.
When field1 was changed, I noticed that field2 still allowed the previous (non-valid) value. This was also caused by the <ALLOWEXISTINGVALUE> rule for field2.
I introduced this rule to allow old -no longer used- values for field2, but this also resulted in the above behavior which I did not want.
In this case I could solve the problem with a WHENCHANGED condition that detects the change in field1 and then sets field2 to a non-valid value, so the user is forced to select a new valid value for field2.
In the AssignedTo-case I have no workaround, but then you could argue whether it is necessary to allow work items to be assigned to users that are no longer part of the Team.