visual-studio - TFS 工作项类型定义 System.AssignedTo 转换错误

标签 visual-studio tfs tfs-workitem

尝试通过 Visual Studio 更改自定义工作项的状态时遇到以下错误:

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

在状态转换期间,另一个字段的值将复制到 System.AssignedTo 字段。在通过 Visual Studio checkin 期间,此错误阻止我解决相关工作项。

我注意到以下替代方案允许我成功更改状态,这可以帮助指出问题所在:

  • 更改网络界面中工作项的状态。这里没有显示任何错误。
  • 在 Visual Studio 中转换之前复制的字段中重新输入用户名。
  • 在 Visual Studio 中进行转换后,在 System.AssignedTo 字段中重新输入用户名。

以下是我认为与此问题相关的自定义工作项类型定义中的状态、转换和字段的子集:

<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>

最佳答案

问题最终是字段 Project.Tfs.Lead 没有 syncnamechanges="true"。以下是更改后该字段的样子:

<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>

进行更改时,请确保使用 witadmin changefield(如以下命令),因为该字段需要跨工作项类型定义进行更新。导入 xml 更改将不起作用,并且会向您发出警告 TF248017。

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

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

关于visual-studio - TFS 工作项类型定义 System.AssignedTo 转换错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43547935/

相关文章:

visual-studio - 无法执行分支,抛出数据库更新错误

c# - 在 .NET 中动态加载程序集的问题

c# - 为什么 Visual Studio 找不到这个 nuget 包的 .props 文件?

visual-studio - 您可以安装不需要 Visual Studio 的独立 TFS 客户端吗?

azure-devops - VSTS 在两个版本之间查找工作项

TFS 混淆了团队、区域、项目、区域、迭代

tfs - 我们可以迁移到新的TFS流程模板并保留历史记录吗?

c - 使用 float 格式说明符打印 int 变量

api - TFS 2013 API 项目创建

tfs - 使用 tf.exe 在一个变更集中 checkin 多个文件