Azure DevOps Migration Tools allow you to migrate Teams, Backlogs, Tasks, Test Cases, and Plans & Suits from one Project to another in Azure DevOps / TFS both within the same Organisation, and between Organisations.
System.NullReferenceException: Object reference not set to an instance of an object.
at VstsSyncMigrator.Engine.TestPlansAndSuitesMigrationContext.ProcessTestPlan(ITestPlan sourcePlan) in D:\DEV\git\azure-devops-migration-tools\src\VstsSyncMigrator.Core\Execution\MigrationContext\TestPlansAndSuitesMigrationContext.cs:line 935
at VstsSyncMigrator.Engine.TestPlansAndSuitesMigrationContext.InternalExecute() in D:\DEV\git\azure-devops-migration-tools\src\VstsSyncMigrator.Core\Execution\MigrationContext\TestPlansAndSuitesMigrationContext.cs:line 138
at MigrationTools._EngineV1.Processors.MigrationProcessorBase.Execute() in D:\DEV\git\azure-devops-migration-tools\src\MigrationTools\_EngineV1\Processors\MigrationProcessorBase.cs:line 46
2023-10-12 10:18:41.837 +02:00 [ERR] TestPlansAndSuitesMigrationContext The Processor MigrationEngine entered the failed state...stopping run
Maybe i miss something:
In the existing code the same work item is used to determine the expected and the actual reflected id.
According to my understanding the condition "if (workItemReflectedId != expectedReflectedId)" in the original code will always be true. Which does results later in the program to a null pointer exception.
I have changed the code to the following:
private ITestPlan FindTestPlan(TestManagementContext tmc, string name, ITestPlan sourcePlan)
{
ITestPlan testPlan = (from p in tmc.Project.TestPlans.Query("Select * From TestPlan") where p.Name == name select p).SingleOrDefault();
if (testPlan != null)
{
//Check test plan is in fact the right one
var targetWI = Engine.Source.WorkItems.GetWorkItem(testPlan.Id.ToString());
var sourceWI = Engine.Source.WorkItems.GetWorkItem(sourcePlan.Id.ToString());
string expectedReflectedId = Engine.Source.WorkItems.CreateReflectedWorkItemId(sourceWI).ToString();
string workItemReflectedId = (string)targetWI.Fields[Engine.Target.Config.AsTeamProjectConfig().ReflectedWorkItemIDFieldName].Value;
if (workItemReflectedId != expectedReflectedId)
{
testPlan = null;
}
}
return testPlan;
}
Version
Source Version
Azure DevOps Server 2020
Target Version
Azure DevOps Server 2020
Relevant configuration
Relevant log output
What happened?
I guess the issue is related to commit https://github.com/nkdAgility/azure-devops-migration-tools/commit/119e5cb4d00030678953e31449c4542a20ba4c2f
Maybe i miss something:
In the existing code the same work item is used to determine the expected and the actual reflected id. According to my understanding the condition "if (workItemReflectedId != expectedReflectedId)" in the original code will always be true. Which does results later in the program to a null pointer exception.
I have changed the code to the following:
Debug in Visual Studio