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

Azure DevOps迁移工具无法迁移Hierarchy-Forward类型父子链接求助

Azure DevOps迁移工具父子链接迁移失败问题

我使用Azure DevOps Migration Tools在同一组织的两个Azure项目间迁移各类工作项。查阅大量资料及文档后,始终无法找到可靠的父子链接(System.LinkTypes.Hierarchy-Forward类型)迁移至目标项目的解决方案。尝试将LinkMigrationSaveEachAsAdded参数设置为true或false,均未生效。

我的配置文件如下:

{"Version": "12.0","LogLevel": "Verbose","workaroundForQuerySOAPBugEnabled": false,"Source": {"$type": "TfsTeamProjectConfig","Collection": "https://dev.azure.com/MyNameOrg/","Project": "SourceProject","ReflectedWorkItemIDFieldName": "TfsMigrationTool.ReflectedWorkItemId","AuthenticationMode": "AccessToken","AllowCrossProjectLinking": false,"PersonalAccessToken": "MyTokenHidden","LanguageMaps": {"AreaPath": "Area","IterationPath": "Iteration"}},"Target": {"$type": "TfsTeamProjectConfig","Collection": "https://dev.azure.com/MyNameOrg/","Project": "DestinationProject","ReflectedWorkItemIDFieldName": "Custom.ReflectedWorkItemId","AuthenticationMode": "AccessToken","AllowCrossProjectLinking": false,"PersonalAccessToken": "MyTokenHidden","LanguageMaps": {"AreaPath": "Area","IterationPath": "Iteration"}},"FieldMaps": [{"$type": "TreeToTagMapConfig","WorkItemTypeName": "*","toSkip": 3,"timeTravel": 1}],"WorkItemTypeDefinition": {"sourceWorkItemTypeName": "targetWorkItemTypeName"},"GitRepoMapping": null,"Processors": [{"$type": "WorkItemMigrationConfig","Enabled": true,"ReplayRevisions": true,"PrefixProjectToNodes": false,"UpdateCreatedDate": true,"UpdateCreatedBy": true,"WIQLQueryBit": " AND [Custom.ReqID] contains 'CR' AND [System.WorkItemType] NOT IN ('Test Suite', 'Test Plan')","WIQLOrderBit": "[System.ChangedDate] desc","LinkMigration": true,"AttachmentMigration": true,"AttachmentWorkingPath": "c:\\temp\\WorkItemAttachmentWorkingFolder\\","FixHtmlAttachmentLinks": false,"SkipToFinalRevisedWorkItemType": false,"WorkItemCreateRetryLimit": 5,"FilterWorkItemsThatAlreadyExistInTarget": false,"PauseAfterEachWorkItem": false,"AttachmentMaxSize": 480000000,"AttachRevisionHistory": false,"LinkMigrationSaveEachAsAdded": true,"GenerateMigrationComment": false,"WorkItemIDs": null,"MaxRevisions": 0,"NodeStructureEnricherEnabled": true,"UseCommonNodeStructureEnricherConfig": false,"NodeBasePaths": [],"AreaMaps": {},"IterationMaps": {},"MaxGracefulFailures": 0}]}

迁移时出现以下错误日志:

[SKIP] Unable to migrate link where Link of type System.LinkTypes.Hierarchy-Forward where wiSourceL=182, wiSourceR=222, wiTargetL=189, wiTargetR=222 as target WI has not been migrated #1335


解决方案

1. 排查工作项查询范围

错误核心是关联的工作项未被迁移,你的WIQL查询AND [Custom.ReqID] contains 'CR'可能漏掉了部分父/子工作项。检查所有存在父子链接的工作项,确保它们都满足查询条件;同时确认没有误排除相关工作项类型。

2. 调整迁移顺序确保依赖优先

父子链接要求父项先于子项完成迁移。当前排序规则[System.ChangedDate] desc无法保证层级顺序,建议修改WIQLOrderBit为层级优先的排序:

[System.NodeName] asc

或者直接按工作项类型+ID排序,确保父项先迁移:

[System.WorkItemType] asc, [System.Id] asc

3. 完善节点结构同步配置

启用NodeStructureEnricherEnabled后,需明确配置源和目标项目的区域/迭代路径映射,确保层级结构一致,这是链接匹配的基础:

"NodeBasePaths": [
  "SourceProject\\Area",
  "SourceProject\\Iteration"
],
"AreaMaps": {
  "SourceProject\\Area": "DestinationProject\\Area"
},
"IterationMaps": {
  "SourceProject\\Iteration": "DestinationProject\\Iteration"
}

4. 验证反射工作项ID字段

源和目标的ReflectedWorkItemIDFieldName分别为TfsMigrationTool.ReflectedWorkItemId和Custom.ReflectedWorkItemId,需确认目标项目已创建Custom.ReflectedWorkItemId自定义字段,且工具拥有写入权限——这个字段是工具关联源/目标工作项的核心标识,缺失会导致链接匹配失败。

5. 临时禁用版本回放测试

ReplayRevisions: true可能在回放历史版本时干扰链接创建,可临时将其设为false,测试链接是否能正常迁移,确认后再重新启用版本回放。


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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.08 18:25:28