nkdAgility/azure-devops-migration-tools

[Bug]: Error while running TestPlansAndSuitesMigrationContext: TF237124: Work Item is not ready to save

habrazilay opened this issue · 1 comments

Version

  • I confirm that I am using the latest version

Source Version

Azure DevOps Server 2020

Target Version

Azure DevOps Server 2020

Relevant configuration

{
      "$type": "TestVariablesMigrationConfig",
      "Enabled": false
    },
    {
      "$type": "TestConfigurationsMigrationConfig",
      "Enabled": true
    },
    {
      "$type": "TestPlansAndSuitesMigrationConfig",
      "Enabled": true,
      "PrefixProjectToNodes": false,
      "OnlyElementsWithTag": null,
      "TestPlanQueryBit": null,
      "RemoveAllLinks": false,
      "MigrationDelay": 0,
      "UseCommonNodeStructureEnricherConfig": false,
      "NodeBasePaths": [],
      "IterationMaps": {
        "^OriginalProject\\\\Iteration 1": "TargetProject\\Iteration 1",
        "^OriginalProject\\\\Iteration 2": "TargetProject\\Iteration 2",
        "^OriginalProject\\\\Iteration 3": "TargetProject\\Iteration 3",
        "^OriginalProject\\\\Iteration 4": "TargetProject\\Iteration 4",
        "^OriginalProject\\\\Iteration 5": "TargetProject\\Iteration 5",
        "^OriginalProject\\\\Iteration 6": "TargetProject\\Iteration 6",
        "^OriginalProject\\\\Iteration 7": "TargetProject\\Iteration 7",
        "^OriginalProject\\\\Iteration 8": "TargetProject\\Iteration 8",
        "^OriginalProject\\\\Iteration 9": "TargetProject\\Iteration 9",
        "^OriginalProject\\\\Iteration 10": "TargetProject\\Iteration 10",
        "^OriginalProject\\\\Iteration 11": "TargetProject\\Iteration 11",
        "^OriginalProject\\\\Iteration 12": "TargetProject\\Iteration 12",
        "^OriginalProject\\\\Iteration 13": "TargetProject\\Iteration 13",
        "^OriginalProject\\\\Iteration 14": "TargetProject\\Iteration 14",
        "^OriginalProject\\\\Iteration 15": "TargetProject\\Iteration 15",
        "^OriginalProject\\\\Iteration 16": "TargetProject\\Iteration 16",
        "^OriginalProject\\\\Iteration 17": "TargetProject\\Iteration 17",
        "^OriginalProject\\\\Iteration 18": "TargetProject\\Iteration 18",
        "^OriginalProject\\\\Iteration 19": "TargetProject\\Iteration 19",
        "^OriginalProject\\\\Iteration 20": "TargetProject\\Iteration 20",
        "^OriginalProject\\\\Iteration 21": "TargetProject\\Iteration 21",
        "^OriginalProject\\\\Iteration 22": "TargetProject\\Iteration 22",
        "^OriginalProject\\\\Iteration 23": "TargetProject\\Iteration 23",
        "^OriginalProject\\\\Iteration 24": "TargetProject\\Iteration 24",
        "^OriginalProject\\\\Iteration 25": "TargetProject\\Iteration 25",
        "^OriginalProject\\\\Iteration 26": "TargetProject\\Iteration 26",
        "^OriginalProject\\\\Iteration 27": "TargetProject\\Iteration 27",
        "^OriginalProject\\\\Iteration 28": "TargetProject\\Iteration 28",
        "^OriginalProject\\\\Iteration 29": "TargetProject\\Iteration 29",
        "^OriginalProject\\\\Iteration 30": "TargetProject\\Iteration 30",
        "^OriginalProject\\\\BackLog": "TargetProject\\Future backLog"
      },
      "AreaMaps": {
        "^sourceproject": "targetproject\\Daniel_TPC_TEST"
      },
      "RemoveInvalidTestSuiteLinks": false,
      "FilterCompleted": false,
      "ShouldCreateMissingRevisionPaths": true
    }

Relevant log output

[13:57:33 WRN] [v14.4.6] Work Item is not ready to save as it has some invalid fields. This may not result in an error. Enable LogLevel as 'Debug' in the config to see more.
[13:57:33 DBG] [v14.4.6] --------------------------------------------------------------------------------------------------------------------
[13:57:33 DBG] [v14.4.6] --------------------------------------------------------------------------------------------------------------------
[13:57:33 DBG] [v14.4.6] TfsExtensions::ToJson
[13:57:33 DBG] [v14.4.6] Invalid Field Object:
{
  "WorkItemId": 13136,
  "CurrentRevisionWorkItemRev": 1,
  "CurrentRevisionWorkItemTypeName": "Test Suite",
  "Name": "Reason",
  "ReferenceName": "System.Reason",
  "Value": "",
  "OriginalValue": "",
  "ValueWithServerDefault": "",
  "Status": 1,
  "IsRequired": true,
  "IsEditable": true,
  "IsDirty": false,
  "IsComputed": false,
  "IsChangedByUser": false,
  "IsChangedInRevision": false,
  "HasPatternMatch": false,
  "IsLimitedToAllowedValues": false,
  "HasAllowedValuesList": false,
  "AllowedValues": [],
  "IdentityFieldAllowedValues": [],
  "ProhibitedValues": []
}
[13:57:33 DBG] [v14.4.6] --------------------------------------------------------------------------------------------------------------------
[13:57:33 DBG] [v14.4.6] --------------------------------------------------------------------------------------------------------------------
[13:57:33 DBG] [v14.4.6] TfsWorkItemMigrationClient::GetWorkItem(642)
[13:57:33 DBG] [v14.4.6] TfsWorkItemMigrationClient::GetWorkItem(13136)
[13:57:33 DBG] [v14.4.6] TfsExtensions::SaveToAzureDevOps
[13:57:33 DBG] [v14.4.6] TfsExtensions::SaveToAzureDevOps: ChangedBy: Daniel Schmidt, AuthorisedBy: Daniel Schmidt
[13:57:33 WRN] [v14.4.6] Work Item is not ready to save as it has some invalid fields. This may not result in an error. Enable LogLevel as 'Debug' in the config to see more.
[13:57:33 DBG] [v14.4.6] --------------------------------------------------------------------------------------------------------------------
[13:57:33 DBG] [v14.4.6] --------------------------------------------------------------------------------------------------------------------
[13:57:33 DBG] [v14.4.6] TfsExtensions::ToJson
[13:57:33 DBG] [v14.4.6] Invalid Field Object:
{
  "WorkItemId": 13136,
  "CurrentRevisionWorkItemRev": 1,
  "CurrentRevisionWorkItemTypeName": "Test Suite",
  "Name": "Reason",
  "ReferenceName": "System.Reason",
  "Value": "",
  "OriginalValue": "",
  "ValueWithServerDefault": "",
  "Status": 1,
  "IsRequired": true,
  "IsEditable": true,
  "IsDirty": false,
  "IsComputed": false,
  "IsChangedByUser": false,
  "IsChangedInRevision": false,
  "HasPatternMatch": false,
  "IsLimitedToAllowedValues": false,
  "HasAllowedValuesList": false,
  "AllowedValues": [],
  "IdentityFieldAllowedValues": [],
  "ProhibitedValues": []
}
[13:57:33 DBG] [v14.4.6] --------------------------------------------------------------------------------------------------------------------
[13:57:33 DBG] [v14.4.6] --------------------------------------------------------------------------------------------------------------------
[13:57:33 FTL] [v14.4.6] Error while running TestPlansAndSuitesMigrationContext
Microsoft.TeamFoundation.WorkItemTracking.Client.ValidationException: TF237124: Work Item is not ready to save
   at Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItem.Save(SaveFlags saveFlags)
   at MigrationTools.TfsExtensions.SaveToAzureDevOps(WorkItemData context) in D:\a\1\s\src\MigrationTools.Clients.AzureDevops.ObjectModel\TfsExtensions.cs:line 77
   at VstsSyncMigrator.Engine.TestPlansAndSuitesMigrationContext.AssignReflectedWorkItemId(Int32 sourceWIId, Int32 targetWIId) in D:\a\1\s\src\VstsSyncMigrator.Core\Execution\MigrationContext\TestPlansAndSuitesMigrationContext.cs:line 395
   at VstsSyncMigrator.Engine.TestPlansAndSuitesMigrationContext.ProcessTestPlan(ITestPlan sourcePlan) in D:\a\1\s\src\VstsSyncMigrator.Core\Execution\MigrationContext\TestPlansAndSuitesMigrationContext.cs:line 912
   at VstsSyncMigrator.Engine.TestPlansAndSuitesMigrationContext.InternalExecute() in D:\a\1\s\src\VstsSyncMigrator.Core\Execution\MigrationContext\TestPlansAndSuitesMigrationContext.cs:line 129
   at MigrationTools._EngineV1.Processors.MigrationProcessorBase.Execute() in D:\a\1\s\src\MigrationTools\_EngineV1\Processors\MigrationProcessorBase.cs:line 47
[13:57:33 ERR] [v14.4.6] TestPlansAndSuitesMigrationContext The Processor MigrationEngine entered the failed state...stopping run
[13:57:33 INF] [v14.4.6] Application is shutting down...
[13:57:33 DBG] [v14.4.6] Hosting stopping
[13:57:33 DBG] [v14.4.6] Exiting with return code: 0
[13:57:33 INF] [v14.4.6] Application Ending
[13:57:33 INF] [v14.4.6] The application ran in 00:49:48.9709539 and finished at 01/24/2024 13:57:33
[13:57:33 DBG] [v14.4.6] Hosting stopped

What happened?

I am trying to migrate only Test Plans and Suits, but does not matter what I do I keep receiving this error: Microsoft.TeamFoundation.WorkItemTracking.Client.ValidationException: TF237124: Work Item is not ready to save.

I did check everything I could. It seems to be related to "ReferenceName": "System.Reason" - There is something I need to change in order to make it work? It seems like a bug.

Thank you in advance :)

image

Debug in Visual Studio

  • Visual Studio Debug

It's not a bug. My bad. I forgot to add the Work type under "FieldMaps"

{
"$type": "FieldValueMapConfig",
"WorkItemTypeName": "Test plan",
"sourceField": "System.State",
"targetField": "System.State",
"valueMapping": {
"Active": "Active",
"Inactive": "Inactive",
"Not Relevant": "Not Relevant"
}
},
{
"$type": "FieldValueMapConfig",
"WorkItemTypeName": "Test Suite",
"sourceField": "System.State",
"targetField": "System.State",
"valueMapping": {
"In Planning": "In Planning",
"In Progress": "In Progress",
"Not Relevant": "Not Relevant",
"Completed": "Completed"
}
},
{
"$type": "FieldValueMapConfig",
"WorkItemTypeName": "Test Case",
"sourceField": "System.State",
"targetField": "System.State",
"valueMapping": {
"Design": "Design",
"Ready": "Ready",
"Not Relevant": "Not Relevant",
"Closed": "Closed"
}

Now it's working