You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Azure DevOps工作项迁移遇ValidatingRequiredField异常求助

解决Azure DevOps工作项迁移中ReflectedWorkItemId字段验证失败问题

问题现象

迁移4000+工作项至目标Azure DevOps项目时,所有工作项均无法导入,触发以下错误:

ValidatingRequiredField: User Story does not contain ReflectedWorkItemId
[13:26:56 ERR] Not all work items in scope contain a valid ReflectedWorkItemId Field!

当前迁移配置

{
  "ChangeSetMappingFile": null,
  "Source": {
    "$type": "TfsTeamProjectConfig",
    "Collection": "https://dev.azure.com/PriscillaFuentes/",
    "Project": "PriscillaFuentes",
    **"ReflectedWorkItemIDFieldName": "ReflectedWorkItemId"**,
    "AllowCrossProjectLinking": false,
    "AuthenticationMode": "Prompt",
    "PersonalAccessTokenVariableName": "",
    "LanguageMaps": {
      "AreaPath": "Area",
      "IterationPath": "Iteration"
    }
  },
  "Target": {
    "$type": "TfsTeamProjectConfig",
    "Collection": "https://dev.azure.com/TexasFirstRentals/",
    "Project": "RentalTechOps",
    **"ReflectedWorkItemIDFieldName": "ReflectedWorkItemId",**
    "AllowCrossProjectLinking": false,
    "AuthenticationMode": "Prompt",
    "PersonalAccessTokenVariableName": "",
    "LanguageMaps": {
      "AreaPath": "Area",
      "IterationPath": "Iteration"
    }
  },
 **"ReflectedWorkItemIDFieldName": "TfsMigrationTool.ReflectedWorkItemId",**
  "FieldMaps": [],
  "GitRepoMapping": null,
  "LogLevel": "Information",
  "CommonEnrichersConfig": null,
  "Processors": [
    {
      "$type": "WorkItemMigrationConfig",
      "Enabled": true,
      "ReplayRevisions": true,
      "PrefixProjectToNodes": false,
      "UpdateCreatedDate": true,
      "UpdateCreatedBy": true,
      "WIQLQueryBit": "",
      "WIQLOrderBit": "[System.ChangedDate] desc",
      "LinkMigration": true,
      "AttachmentMigration": true,
      "AttachmentWorkingPath": "c:\\temp\\WorkItemAttachmentWorkingFolder\\",
      "FixHtmlAttachmentLinks": false,
      "SkipToFinalRevisedWorkItemType": true,
      "WorkItemCreateRetryLimit": 5,
      "FilterWorkItemsThatAlreadyExistInTarget": false,
      "PauseAfterEachWorkItem": false,
      "AttachmentMaxSize": 480000000,
      "AttachRevisionHistory": false,
      "LinkMigrationSaveEachAsAdded": false,
      "GenerateMigrationComment": true,
      "WorkItemIDs": null,
      "MaxRevisions": 0,
      "UseCommonNodeStructureEnricherConfig": false,
      "StopMigrationOnMissingAreaIterationNodes": false,
      "NodeBasePaths": [],
      "AreaMaps": {
        "^OriginalProject\\\\(?!DescopeThis|DescopeThat)": "TargetProject\\RentalTechOps\\TFR-HIR\\"
      },
      "IterationMaps": {},
      "MaxGracefulFailures": 0,
      "SkipRevisionWithInvalidIterationPath": false,
      "SkipRevisionWithInvalidAreaPath": false
    }
  ],
  "Version": "13.0",
  "workaroundForQuerySOAPBugEnabled": false,
  "WorkItemTypeDefinition": {
    "sourceWorkItemTypeName": "targetWorkItemTypeName"
  },
  "Endpoints": {
    "InMemoryWorkItemEndpoints": [
      {
        "Name": "Source",
        "EndpointEnrichers": null
      },
      {
        "Name": "Target",
        "EndpointEnrichers": null
      }
    ]
  }
}

已尝试的无效配置

{
"$type": "FieldSkipMapConfig",
"WorkItemTypeName": "*",
"targetField": "TfsMigrationTool.ReflectedWorkItemId"
}

解决方案

1. 统一ReflectedWorkItemId字段配置

配置中全局、源、目标节点的ReflectedWorkItemIDFieldName值不一致,导致工具识别混乱。需将三者统一为工具默认的系统字段TfsMigrationTool.ReflectedWorkItemId,修改后的核心配置片段:

"Source": {
  // 其他配置保留
  "ReflectedWorkItemIDFieldName": "TfsMigrationTool.ReflectedWorkItemId",
},
"Target": {
  // 其他配置保留
  "ReflectedWorkItemIDFieldName": "TfsMigrationTool.ReflectedWorkItemId",
},
"ReflectedWorkItemIDFieldName": "TfsMigrationTool.ReflectedWorkItemId",

2. 移除无效的FieldSkipMapConfig

TfsMigrationTool.ReflectedWorkItemId是迁移工具关联源与目标工作项的核心字段,不能跳过。直接清空FieldMaps数组即可。

3. 验证目标项目字段兼容性

无需手动在目标项目创建该字段,迁移工具会自动在目标工作项上生成并填充。若之前手动删除过该字段,可先迁移1-2个测试工作项触发字段自动创建。

4. 小规模测试验证

先指定少量工作项ID进行测试,确认配置生效后再批量迁移:

"Processors": [
  {
    "$type": "WorkItemMigrationConfig",
    // 其他配置保留
    "WorkItemIDs": [123, 456], // 替换为源项目中存在的工作项ID
  }
]

内容的提问来源于stack exchange,提问作者Venkat Ambati

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.19 15:27:57