2
votes

I'm getting the following error when trying to change a custom work item's state through Visual Studio:

The field 'Assigned To' contains the value 'Seth Denburg <Project\SDenburg>' that is not in the list of supported values.

During the state transition the value from another field is copied to the System.AssignedTo field. This error stopping me from resolving a related work item during my check in through Visual Studio.

I've noticed the following alternatives allow me to successfully change the state which could help point to what the issue is:

  • Changing the work item's state in the web interface. No errors are displayed here.
  • Reentering the user's name in the field being copied from before the transition in Visual Studio.
  • Reentering the user's name in the System.AssignedTo field after the transition in Visual Studio.

Here is a subset of states, transitions, and fields from the custom work item type definition that I think are related to this issue:

<FIELD name="Assigned To" refname="System.AssignedTo" type="String" syncnamechanges="true" reportable="dimension">
    <ALLOWEXISTINGVALUE />
    <VALIDUSER group="Project\Users" />
</FIELD>

<FIELD name="Lead" refname="Project.Tfs.Lead" type="String" reportable="dimension">
    <ALLOWEXISTINGVALUE />
    <DEFAULT from="value" value="Seth Denburg" />
    <REQUIRED />
    <VALIDUSER group="Project\TechnicalLeads" />
</FIELD>

<STATE value="Pending">
  <FIELDS>
    <FIELD refname="System.AssignedTo">
      <VALIDUSER />
    </FIELD>
  </FIELDS>
</STATE>

<TRANSITION from="Active" to="Pending">
  <REASONS>
    <DEFAULTREASON value="Completed" />
  </REASONS>
  <FIELDS>
    <FIELD refname="System.AssignedTo">
      <COPY from="field" field="Project.Tfs.Lead" />
    </FIELD>
  <ACTIONS>
    <ACTION value="Microsoft.VSTS.Actions.Checkin" />
  </ACTIONS>
</TRANSITION>
2
@Patrick-MSFT What do you mean? The display name has a space and that is shown in the Visual Studio rendering of that field. If I remove the space then it says the value is not in the list of supported values. - Seth Denburg
Sorry for the misunderstanding. What's the result if you use another user to change the custom work item's state? And did you still get the error when you use your account to change the state in the VS on another machine? If so, seems to be a client issue. Give a try with clear VS and TFS cache, then try again. - PatrickLu-MSFT
@Patrick-MSFT This is happening for everyone on our project across multiple machines. Another thing to note is that this started happening around when we upgraded from TFS 2012 to 2015. - Seth Denburg

2 Answers

2
votes

The issue ended up being that the field Project.Tfs.Lead didn't have syncnamechanges="true". Here is what the field looked like after the change was made:

<FIELD name="Lead" refname="Project.Tfs.Lead" type="String" syncnamechanges="true" reportable="dimension">
    <ALLOWEXISTINGVALUE />
    <DEFAULT from="value" value="Seth Denburg" />
    <REQUIRED />
    <VALIDUSER group="Project\TechnicalLeads" />
</FIELD>

When making the change ensure that you use witadmin changefield like the following command because the field needs to be updated across work item type definitions. Importing an xml change won't work and will give you warning TF248017.

witadmin changefield /collection:https://project.com/tfs/projectCollection/ /n:Project.Tfs.Lead /syncnamechanges:true

Here's why this change was necessary from MSDN:

You must manually enable synchronization of any custom work item fields that you have created in previous releases of Visual Studio Team Foundation Server and that are used to assign person names that reference Active Directory. You must enable synchronization for each field for each team project collection that contains the custom fields.

https://msdn.microsoft.com/en-us/library/dd286562(v=vs.100).aspx

1
votes

Have created a test in myside, works well. The code of the custom work item type definition above seems missing a </FIELDS> of TRANSITION part.

Make sure the user Seth Denburg is in both group Project\TechnicalLeads and Project\Users.

You could also create a new team project in TFS2015 and use this custom work item type definition to see if the issue still exists. If not, the issue should related to the upgrade from TFS 2012 to 2015. Make sure you have Configure features after an upgrade.