0

我正在尝试使用“azure-devops-migration-tool”来迁移工作项。我想要实现的是在一个查询中查询所有未设置关闭的项目以及所有直接链接的项目。这可以在 Azure DevOps UI 中完成,但我无法在该工具中使用相同的查询。

一个示例查询将是这样的:

 "QueryBit": "AND ( [Source].[System.WorkItemType] <> '' AND [Source].[System.State] <> '' AND [Source].[Microsoft.VSTS.Common.ClosedDate] = '') AND ([Target].[System.WorkItemType] <> '')"

运行该工具后,我会遇到异常

  [EXCEPTION] Microsoft.TeamFoundation.WorkItemTracking.Client.ValidationException: TF51005: The query references a field that does not exist. The error is caused by «Source.[System.WorkItemType]».
   at Microsoft.TeamFoundation.WorkItemTracking.Client.Query.Initialize(WorkItemStore store, String wiql, IDictionary context, Int32[] ids, Int32[] revs, Boolean dayPrecision)
   at Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItemStore.Query(String wiql, IDictionary context)
   at VstsSyncMigrator.Engine.TfsQueryContext.Execute() in d:\a\1\s\src\VstsSyncMigrator.Core\Execution\ComponentContext\TfsQueryContext.cs:line 72
migration.exe Warning: 0 :   [EXCEPTION] Microsoft.TeamFoundation.WorkItemTracking.Client.ValidationException: TF51005: The query references a field that does not exist. The error is caused by «Source.[System.WorkItemType]».
   at Microsoft.TeamFoundation.WorkItemTracking.Client.Query.Initialize(WorkItemStore store, String wiql, IDictionary context, Int32[] ids, Int32[] revs, Boolean dayPrecision)
   at Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItemStore.Query(String wiql, IDictionary context)
   at VstsSyncMigrator.Engine.TfsQueryContext.Execute() in d:\a\1\s\src\VstsSyncMigrator.Core\Execution\ComponentContext\TfsQueryContext.cs:line 99
   at VstsSyncMigrator.Engine.WorkItemMigrationContext.InternalExecute() in d:\a\1\s\src\VstsSyncMigrator.Core\Execution\MigrationContext\WorkItemMigrationContext.cs:line 101
   at VstsSyncMigrator.Engine.MigrationContextBase.Execute() in d:\a\1\s\src\VstsSyncMigrator.Core\Execution\MigrationContext\MigrationContextBase.cs:line 35

有什么建议么?

4

2 回答 2

1

发现问题,是工具不支持从“WorkItemLinks”查询。它只支持“工作项类型查询的平面列表”

于 2020-12-06T11:39:36.553 回答
0

尝试 wiql 编辑器插件 - https://marketplace.visualstudio.com/items?itemName=ottostreifel.wiql-editor

这使您可以使用 UI 构建查询并使用编辑器将它们转换为 wiql。您可以将它们复制并粘贴到您的配置文件中

于 2020-11-03T12:31:40.490 回答