TF51005: The query references a field that does not exist. The error is caused by «[Custom.Reflected

%3CLINGO-SUB%20id%3D%22lingo-sub-3209316%22%20slang%3D%22en-US%22%3ETF51005%3A%20The%20query%20references%20a%20field%20that%20does%20not%20exist.%20The%20error%20is%20caused%20by%20%C2%AB%5BCustom.Reflected%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3209316%22%20slang%3D%22en-US%22%3E%3CP%3EI%20try%20to%20migrate%20Azure%20DevOps%20boards%20from%20one%20organization%20to%20another%20(cloud-to-cloud%2C%20I%20know%20there%20is%20a%20migration%20tool%20for%20local-to-cloud).%3C%2FP%3E%3CP%3ESince%20I%20cannot%20find%20a%20official%20solution%20for%20this.%20I%20try%20to%20use%20this%20tool%3A%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FnkdAgility%2Fazure-devops-migration-tools%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2FnkdAgility%2Fazure-devops-migration-tools%3C%2FA%3E%3C%2FP%3E%3CP%3EI%20follow%20the%20instructions%20in%20the%20document%20but%20errors%20occur%3A%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-basic%22%3E%3CCODE%3E%5B16%3A43%3A59%20INF%5D%20Processor%3A%20WorkItemMigration%0A%5B16%3A43%3A59%20INF%5D%20Migration%20Context%20Start%3A%20WorkItemMigration%20%5B16%3A43%3A59%20INF%5D%20WorkItemMigrationContext%3A%3AInternalExecute%20...%0A%5B16%3A44%3A00%20INF%5D%20MigrationClient%3A%20Access%20granted%20to%20https%3A%2F%2Fdev.azure.com%2Fyyy%2F%20for%20xxx%20(Email%20address%20removed)%20...%0A%5B16%3A44%3A03%20INF%5D%20MigrationClient%3A%20Access%20granted%20to%20https%3A%2F%2Fdev.azure.com%2Fzzz%2F%20for%20xxx%20(Email%20address%20removed)%0A%5B16%3A44%3A04%20INF%5D%20Migrating%20all%20Nodes%20before%20the%20Processor%20run.%0A%5B16%3A44%3A05%20WRN%5D%20The%20node%20%5Cxxx%5CIteration%5CSprint%201%20is%20being%20excluded%20due%20to%20your%20basePath%20setting.%0A%5B16%3A44%3A06%20INF%5D%20Querying%20items%20to%20be%20migrated%3A%20SELECT%20%5BSystem.Id%5D%2C%20%5BSystem.Tags%5D%20FROM%20WorkItems%20WHERE%20%5BSystem.TeamProject%5D%20%3D%20%40TeamProject%20AND%20%5BSystem.WorkItemType%5D%20NOT%20IN%20('Test%20Suite'%2C%20'Test%20Plan')%20ORDER%20BY%20%5BSystem.ChangedDate%5D%20desc%20...%0A%5B16%3A44%3A13%20INF%5D%20Replay%20all%20revisions%20of%2020%20work%20items%3F%0A%5B16%3A44%3A13%20INF%5D%20Found%20target%20project%20as%20test-han%20%5B16%3A44%3A13%20INF%5D%20%5BFilterWorkItemsThatAlreadyExistInTarget%5D%20is%20enabled.%20Searching%20for%20work%20items%20that%20have%20already%20been%20migrated%20to%20the%20target...%0A%5B16%3A44%3A13%20ERR%5D%20Error%20running%20query%20Microsoft.TeamFoundation.WorkItemTracking.Client.ValidationException%3A%20TF51005%3A%20The%20query%20references%20a%20field%20that%20does%20not%20exist.%20The%20error%20is%20caused%20by%20%C2%AB%5BCustom.ReflectedWorkItemId%5D%C2%BB.%0Aat%20Microsoft.TeamFoundation.WorkItemTracking.Client.Query.Initialize(WorkItemStore%20store%2C%20String%20wiql%2C%20IDictionary%20context%2C%20Int32%5B%5D%20ids%2C%20Int32%5B%5D%20revs%2C%20Boolean%20dayPrecision)%0Aat%20Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItemStore.Query(String%20wiql%2C%20IDictionary%20context)%0Aat%20MigrationTools._EngineV1.Clients.TfsWorkItemQuery.GetWorkItemsFromQuery(TfsWorkItemMigrationClient%20wiClient)%0Ain%20D%3A%5Ca%5C1%5Cs%5Csrc%5CMigrationTools.Clients.AzureDevops.ObjectModel%5C_EngineV1%5CClients%5CTfsWorkItemQuery.cs%3Aline%2040%0A%0A%5B16%3A44%3A13%20FTL%5D%20Error%20while%20running%20WorkItemMigration%20Microsoft.TeamFoundation.WorkItemTracking.Client.ValidationException%3A%20TF51005%3A%20The%20query%20references%20a%20field%20that%20does%20not%20exist.%20The%20error%20is%20caused%20by%20%C2%AB%5BCustom.ReflectedWorkItemId%5D%C2%BB.%0Aat%20Microsoft.TeamFoundation.WorkItemTracking.Client.Query.Initialize(WorkItemStore%20store%2C%20String%20wiql%2C%20IDictionary%20context%2C%20Int32%5B%5D%20ids%2C%20Int32%5B%5D%20revs%2C%20Boolean%20dayPrecision)%0Aat%20Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItemStore.Query(String%20wiql%2C%20IDictionary%20context)%0Aat%20MigrationTools._EngineV1.Clients.TfsWorkItemQuery.GetWorkItemsFromQuery(TfsWorkItemMigrationClient%20wiClient)%0Ain%20D%3A%5Ca%5C1%5Cs%5Csrc%5CMigrationTools.Clients.AzureDevops.ObjectModel%5C_EngineV1%5CClients%5CTfsWorkItemQuery.cs%3Aline%2070%20at%20MigrationTools._EngineV1.Clients.TfsWorkItemQuery.GetWorkItems()%0Ain%20D%3A%5Ca%5C1%5Cs%5Csrc%5CMigrationTools.Clients.AzureDevops.ObjectModel%5C_EngineV1%5CClients%5CTfsWorkItemQuery.cs%3Aline%2030%0Aat%20MigrationTools._EngineV1.Clients.TfsWorkItemMigrationClient.FilterExistingWorkItems(List%201%20sourceWorkItems%2C%20TfsWiqlDefinition%20wiqlDefinition%2C%20TfsWorkItemMigrationClient%20sourceWorkItemMigrationClient)%0Ain%20D%3A%5Ca%5C1%5Cs%5Csrc%5CMigrationTools.Clients.AzureDevops.ObjectModel%5C_EngineV1%5CClients%5CTfsWorkItemMigrationClient.cs%3Aline%2054%0Aat%20VstsSyncMigrator.Engine.WorkItemMigrationContext.InternalExecute()%0Ain%20D%3A%5Ca%5C1%5Cs%5Csrc%5CVstsSyncMigrator.Core%5CExecution%5CMigrationContext%5CWorkItemMigrationContext.cs%3Aline%20120%0Aat%20MigrationTools._EngineV1.Processors.MigrationProcessorBase.Execute()%0Ain%20D%3A%5Ca%5C1%5Cs%5Csrc%5CMigrationTools%5C_EngineV1%5CProcessors%5CMigrationProcessorBase.cs%3Aline%2047%20%5B16%3A44%3A13%20ERR%5D%20WorkItemMigration%20The%20Processor%20MigrationEngine%20entered%20the%20failed%20state...stopping%20run%0A%5B16%3A44%3A13%20INF%5D%20Application%20is%20shutting%20down...%0A%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E-----------------------------------------------------------------------------------------------%3C%2FP%3E%3CP%3EBelow%20is%20my%20config%20file%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-json%22%3E%3CCODE%3E%7B%0A%22ChangeSetMappingFile%22%3A%20null%2C%0A%22Source%22%3A%20%7B%0A%22%24type%22%3A%20%22TfsTeamProjectConfig%22%2C%0A%22Collection%22%3A%20%22https%3A%2F%2Fdev.azure.com%2Fyyy%2F%22%2C%0A%22Project%22%3A%20%22y01%22%2C%0A%22ReflectedWorkItemIDFieldName%22%3A%20%22Custom.ReflectedWorkItemId%22%2C%0A%22AllowCrossProjectLinking%22%3A%20false%2C%0A%22AuthenticationMode%22%3A%20%22AccessToken%22%2C%0A%22PersonalAccessToken%22%3A%20%22MY_TOKEN%22%2C%0A%22LanguageMaps%22%3A%20%7B%0A%22AreaPath%22%3A%20%22Area%22%2C%0A%22IterationPath%22%3A%20%22Iteration%22%0A%7D%0A%7D%2C%0A%22Target%22%3A%20%7B%0A%22%24type%22%3A%20%22TfsTeamProjectConfig%22%2C%0A%22Collection%22%3A%20%22https%3A%2F%2Fdev.azure.com%2Fzzz%2F%22%2C%0A%22Project%22%3A%20%22z01%22%2C%0A%22ReflectedWorkItemIDFieldName%22%3A%20%22Custom.ReflectedWorkItemId%22%2C%0A%22AllowCrossProjectLinking%22%3A%20false%2C%0A%22AuthenticationMode%22%3A%20%22AccessToken%22%2C%0A%22PersonalAccessToken%22%3A%20%22MY_TOKEN2%22%2C%0A%22LanguageMaps%22%3A%20%7B%0A%22AreaPath%22%3A%20%22Area%22%2C%0A%22IterationPath%22%3A%20%22Iteration%22%0A%7D%0A%7D%2C%0A%22GitRepoMapping%22%3A%20null%2C%0A%22LogLevel%22%3A%20%22Information%22%2C%0A%22Processors%22%3A%20%5B%0A%7B%0A%22%24type%22%3A%20%22WorkItemMigrationConfig%22%2C%0A%22Enabled%22%3A%20true%2C%0A%22ReplayRevisions%22%3A%20false%2C%0A%22PrefixProjectToNodes%22%3A%20false%2C%0A%22UpdateCreatedDate%22%3A%20true%2C%0A%22UpdateCreatedBy%22%3A%20true%2C%0A%22WIQLQueryBit%22%3A%20%22AND%20%5BSystem.WorkItemType%5D%20NOT%20IN%20('Test%20Suite'%2C%20'Test%20Plan')%22%2C%0A%22WIQLOrderBit%22%3A%20%22%5BSystem.ChangedDate%5D%20desc%22%2C%0A%22LinkMigration%22%3A%20false%2C%0A%22AttachmentMigration%22%3A%20false%2C%0A%22AttachmentWorkingPath%22%3A%20%22c%3A%5Ctemp%5CWorkItemAttachmentWorkingFolder%5C%22%2C%0A%22FixHtmlAttachmentLinks%22%3A%20false%2C%0A%22SkipToFinalRevisedWorkItemType%22%3A%20true%2C%0A%22WorkItemCreateRetryLimit%22%3A%205%2C%0A%22FilterWorkItemsThatAlreadyExistInTarget%22%3A%20true%2C%0A%22PauseAfterEachWorkItem%22%3A%20false%2C%0A%22AttachmentMaxSize%22%3A%20480000000%2C%0A%22AttachRevisionHistory%22%3A%20false%2C%0A%22LinkMigrationSaveEachAsAdded%22%3A%20false%2C%0A%22GenerateMigrationComment%22%3A%20false%2C%0A%22NodeStructureEnricherEnabled%22%3A%20null%2C%0A%22NodeBasePaths%22%3A%20%5B%0A%22%2F%22%0A%5D%2C%0A%22WorkItemIDs%22%3A%20null%2C%0A%22MaxRevisions%22%3A%200%0A%7D%0A%5D%2C%0A%22Version%22%3A%20%2211.11%22%2C%0A%22workaroundForQuerySOAPBugEnabled%22%3A%20false%2C%0A%22WorkItemTypeDefinition%22%3A%20%7B%0A%22sourceWorkItemTypeName%22%3A%20%22targetWorkItemTypeName%22%0A%7D%2C%0A%22Endpoints%22%3A%20%7B%0A%22InMemoryWorkItemEndpoints%22%3A%20%5B%0A%7B%0A%22Name%22%3A%20%22Source%22%2C%0A%22EndpointEnrichers%22%3A%20null%0A%7D%2C%0A%7B%0A%22Name%22%3A%20%22Target%22%2C%0A%22EndpointEnrichers%22%3A%20null%0A%7D%0A%5D%0A%7D%0A%7D%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3EI%20follow%20some%20solutions%20from%20other%20articles%2C%20setup%20a%20custom%20column%20called%20'ReflectedItemId'%20for%20workitem%20type%20'Product%20Backlog'%20(just%20this%20type).%20And%20apply%20this%20self-define%20process%20(inherited%20form%20Scrum)%20to%20both%20source%20%26amp%3B%20destination%20project.%20And%20still%20can%20not%20fix%20it.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThen%2C%20I%20try%20to%20run%20the%20query%20shown%20above(error%20log)%20with%20%22Wiql%20playground%20%22%20extension%20on%20source%20project.%20It%20says%20that%20%22%40TeamProject%20%22%20is%20not%20a%20valid%20name%2C%20which%20means%20the%20query%20from%20source%20project%20is%20not%20working%2C%20not%20to%20mention%20the%20succeeding%20tasks%20.%20Am%20I%20understand%20it%20right%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPlease%20give%20me%20some%20suggestion.%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

I try to migrate Azure DevOps boards from one organization to another (cloud-to-cloud, I know there is a migration tool for local-to-cloud).

Since I cannot find a official solution for this. I try to use this tool: https://github.com/nkdAgility/azure-devops-migration-tools

I follow the instructions in the document but errors occur:

[16:43:59 INF] Processor: WorkItemMigration
[16:43:59 INF] Migration Context Start: WorkItemMigration [16:43:59 INF] WorkItemMigrationContext::InternalExecute ...
[16:44:00 INF] MigrationClient: Access granted to https://dev.azure.com/yyy/ for xxx (Email address removed) ...
[16:44:03 INF] MigrationClient: Access granted to https://dev.azure.com/zzz/ for xxx (Email address removed)
[16:44:04 INF] Migrating all Nodes before the Processor run.
[16:44:05 WRN] The node \xxx\Iteration\Sprint 1 is being excluded due to your basePath setting.
[16:44:06 INF] Querying items to be migrated: SELECT [System.Id], [System.Tags] FROM WorkItems WHERE [System.TeamProject] = @TeamProject AND [System.WorkItemType] NOT IN ('Test Suite', 'Test Plan') ORDER BY [System.ChangedDate] desc ...
[16:44:13 INF] Replay all revisions of 20 work items?
[16:44:13 INF] Found target project as test-han [16:44:13 INF] [FilterWorkItemsThatAlreadyExistInTarget] is enabled. Searching for work items that have already been migrated to the target...
[16:44:13 ERR] Error running query Microsoft.TeamFoundation.WorkItemTracking.Client.ValidationException: TF51005: The query references a field that does not exist. The error is caused by «[Custom.ReflectedWorkItemId]».
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 MigrationTools._EngineV1.Clients.TfsWorkItemQuery.GetWorkItemsFromQuery(TfsWorkItemMigrationClient wiClient)
in D:\a\1\s\src\MigrationTools.Clients.AzureDevops.ObjectModel\_EngineV1\Clients\TfsWorkItemQuery.cs:line 40

[16:44:13 FTL] Error while running WorkItemMigration Microsoft.TeamFoundation.WorkItemTracking.Client.ValidationException: TF51005: The query references a field that does not exist. The error is caused by «[Custom.ReflectedWorkItemId]».
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 MigrationTools._EngineV1.Clients.TfsWorkItemQuery.GetWorkItemsFromQuery(TfsWorkItemMigrationClient wiClient)
in D:\a\1\s\src\MigrationTools.Clients.AzureDevops.ObjectModel\_EngineV1\Clients\TfsWorkItemQuery.cs:line 70 at MigrationTools._EngineV1.Clients.TfsWorkItemQuery.GetWorkItems()
in D:\a\1\s\src\MigrationTools.Clients.AzureDevops.ObjectModel\_EngineV1\Clients\TfsWorkItemQuery.cs:line 30
at MigrationTools._EngineV1.Clients.TfsWorkItemMigrationClient.FilterExistingWorkItems(List 1 sourceWorkItems, TfsWiqlDefinition wiqlDefinition, TfsWorkItemMigrationClient sourceWorkItemMigrationClient)
in D:\a\1\s\src\MigrationTools.Clients.AzureDevops.ObjectModel\_EngineV1\Clients\TfsWorkItemMigrationClient.cs:line 54
at VstsSyncMigrator.Engine.WorkItemMigrationContext.InternalExecute()
in D:\a\1\s\src\VstsSyncMigrator.Core\Execution\MigrationContext\WorkItemMigrationContext.cs:line 120
at MigrationTools._EngineV1.Processors.MigrationProcessorBase.Execute()
in D:\a\1\s\src\MigrationTools\_EngineV1\Processors\MigrationProcessorBase.cs:line 47 [16:44:13 ERR] WorkItemMigration The Processor MigrationEngine entered the failed state...stopping run
[16:44:13 INF] Application is shutting down...

 

-----------------------------------------------------------------------------------------------

Below is my config file

{
"ChangeSetMappingFile": null,
"Source": {
"$type": "TfsTeamProjectConfig",
"Collection": "https://dev.azure.com/yyy/",
"Project": "y01",
"ReflectedWorkItemIDFieldName": "Custom.ReflectedWorkItemId",
"AllowCrossProjectLinking": false,
"AuthenticationMode": "AccessToken",
"PersonalAccessToken": "MY_TOKEN",
"LanguageMaps": {
"AreaPath": "Area",
"IterationPath": "Iteration"
}
},
"Target": {
"$type": "TfsTeamProjectConfig",
"Collection": "https://dev.azure.com/zzz/",
"Project": "z01",
"ReflectedWorkItemIDFieldName": "Custom.ReflectedWorkItemId",
"AllowCrossProjectLinking": false,
"AuthenticationMode": "AccessToken",
"PersonalAccessToken": "MY_TOKEN2",
"LanguageMaps": {
"AreaPath": "Area",
"IterationPath": "Iteration"
}
},
"GitRepoMapping": null,
"LogLevel": "Information",
"Processors": [
{
"$type": "WorkItemMigrationConfig",
"Enabled": true,
"ReplayRevisions": false,
"PrefixProjectToNodes": false,
"UpdateCreatedDate": true,
"UpdateCreatedBy": true,
"WIQLQueryBit": "AND [System.WorkItemType] NOT IN ('Test Suite', 'Test Plan')",
"WIQLOrderBit": "[System.ChangedDate] desc",
"LinkMigration": false,
"AttachmentMigration": false,
"AttachmentWorkingPath": "c:\temp\WorkItemAttachmentWorkingFolder\",
"FixHtmlAttachmentLinks": false,
"SkipToFinalRevisedWorkItemType": true,
"WorkItemCreateRetryLimit": 5,
"FilterWorkItemsThatAlreadyExistInTarget": true,
"PauseAfterEachWorkItem": false,
"AttachmentMaxSize": 480000000,
"AttachRevisionHistory": false,
"LinkMigrationSaveEachAsAdded": false,
"GenerateMigrationComment": false,
"NodeStructureEnricherEnabled": null,
"NodeBasePaths": [
"/"
],
"WorkItemIDs": null,
"MaxRevisions": 0
}
],
"Version": "11.11",
"workaroundForQuerySOAPBugEnabled": false,
"WorkItemTypeDefinition": {
"sourceWorkItemTypeName": "targetWorkItemTypeName"
},
"Endpoints": {
"InMemoryWorkItemEndpoints": [
{
"Name": "Source",
"EndpointEnrichers": null
},
{
"Name": "Target",
"EndpointEnrichers": null
}
]
}
}

I follow some solutions from other articles, setup a custom column called 'ReflectedItemId' for workitem type 'Product Backlog' (just this type). And apply this self-define process (inherited form Scrum) to both source & destination project. And still can not fix it.

 

Then, I try to run the query shown above(error log) with "Wiql playground " extension on source project. It says that "@TeamProject " is not a valid name, which means the query from source project is not working, not to mention the succeeding tasks . Am I understand it right?

 

Please give me some suggestion.

0 Replies