Is There Sample Test Plan Migration Config for Version 11.5?

812 views Asked by At

Is There Sample Test Plan Migration Config for Version 11.5?

I was able to migrated all test cases, but now want to re-create the test plans.

For older version (like version 10), I was able to use below config to re-create the test plans after migrating all test cases:

  "Processors": [
    {
      "ObjectType": "MigrationTools.Core.Configuration.Processing.NodeStructuresMigrationConfig",
      "PrefixProjectToNodes": false,
      "Enabled": true,
      "BasePaths": []
    },
    {
      "Enabled": true,  
      "ObjectType": "MigrationTools.Core.Configuration.Processing.TestVariablesMigrationConfig"
    },
    {
      "Enabled": true,  
      "ObjectType": "MigrationTools.Core.Configuration.Processing.TestConfigurationsMigrationConfig"
    },
    {
      "Enabled": true,  
      "ObjectType": "MigrationTools.Core.Configuration.Processing.TestPlansAndSuitesMigrationConfig",
      "PrefixProjectToNodes": false,
      "OnlyElementsWithTag": null,
      "RemoveInvalidTestSuiteLinks": true
    }
  ]

However, I am now getting an exception.

[22:32:54 INF] Config Found, creating engine host
[22:32:55 ERR] An Unhandled exception occured.
System.ArgumentNullException: Value cannot be null.
Parameter name: type
   at System.Activator.CreateInstance(Type type, Boolean nonPublic)
   at System.Activator.CreateInstance(Type type)
   at MigrationTools.Configuration.ProcessorConfigJsonConverter.Create(Type objectType, JObject jObject) in D:\a\1\s\src\MigrationTools\Configuration\ProcessorConfigJsonConverter.cs:line 14

I migrated all test cases using below config:

  "Processors": [
    {
      "ObjectType": "WorkItemMigrationConfig",
      "ReplayRevisions": true,
      "PrefixProjectToNodes": false,
      "UpdateCreatedDate": true,
      "UpdateCreatedBy": true,
      "BuildFieldTable": false,
      "AppendMigrationToolSignatureFooter": false,
      "WIQLQueryBit": "AND [System.WorkItemType] IN ('Test Case')",
      "WIQLOrderBit": "[System.ChangedDate] desc",
      "Enabled": true,
      "LinkMigration": true,
      "AttachmentMigration": true,
      "AttachmentWorkingPath": "c:\\temp\\WorkItemAttachmentWorkingFolder\\",
      "FixHtmlAttachmentLinks": false,
      "SkipToFinalRevisedWorkItemType": false,
      "WorkItemCreateRetryLimit": 5,
      "FilterWorkItemsThatAlreadyExistInTarget": true,
      "PauseAfterEachWorkItem": false,
      "AttachmentMaxSize": 480000000,
      "CollapseRevisions": false,
      "LinkMigrationSaveEachAsAdded": false,
      "NodeBasePaths": [],
      "WorkItemIDs": null
    }

Can someone please provide some insight?

Thanks, Dennis

1

There are 1 answers

2
MrHinsh - Martin Hinshelwood On BEST ANSWER

We are constantly making changes to the tool and when we bump the version number for major or minor it means we have changes something that impacts the configuration.json. In order to simplify the migration.exe init we reduced the output to just that necessary to migrate work items, the most common usage.

If you run migration.exe init --options Full it will give you the complete configuration options that are available.

For example here is the config from v11.6.

{
  "Version": "11.6",
  "workaroundForQuerySOAPBugEnabled": false,
  "WorkItemTypeDefinition": {
    "sourceWorkItemTypeName": "targetWorkItemTypeName"
  },
  "ChangeSetMappingFile": null,
  "Source": {
    "ObjectType": "TeamProjectConfig",
    "Collection": "https://dev.azure.com/nkdagility-preview/",
    "Project": "myProjectName",
    "ReflectedWorkItemIDFieldName": "Custom.ReflectedWorkItemId",
    "AllowCrossProjectLinking": false,
    "PersonalAccessToken": "",
    "LanguageMaps": {
      "AreaPath": "Area",
      "IterationPath": "Iteration"
    }
  },
  "Target": {
    "ObjectType": "TeamProjectConfig",
    "Collection": "https://dev.azure.com/nkdagility-preview/",
    "Project": "myProjectName",
    "ReflectedWorkItemIDFieldName": "Custom.ReflectedWorkItemId",
    "AllowCrossProjectLinking": false,
    "PersonalAccessToken": "",
    "LanguageMaps": {
      "AreaPath": "Area",
      "IterationPath": "Iteration"
    }
  },
  "FieldMaps": [
    {
      "ObjectType": "MultiValueConditionalMapConfig",
      "WorkItemTypeName": "*",
      "sourceFieldsAndValues": {
        "Field1": "Value1",
        "Field2": "Value2"
      },
      "targetFieldsAndValues": {
        "Field1": "Value1",
        "Field2": "Value2"
      }
    },
    {
      "ObjectType": "FieldBlankMapConfig",
      "WorkItemTypeName": "*",
      "targetField": "TfsMigrationTool.ReflectedWorkItemId"
    },
    {
      "ObjectType": "FieldValueMapConfig",
      "WorkItemTypeName": "*",
      "sourceField": "System.State",
      "targetField": "System.State",
      "defaultValue": "New",
      "valueMapping": {
        "Approved": "New",
        "New": "New",
        "Committed": "Active",
        "In Progress": "Active",
        "To Do": "New",
        "Done": "Closed",
        "Removed": "Removed"
      }
    },
    {
      "ObjectType": "FieldtoFieldMapConfig",
      "WorkItemTypeName": "*",
      "sourceField": "Microsoft.VSTS.Common.BacklogPriority",
      "targetField": "Microsoft.VSTS.Common.StackRank",
      "defaultValue": null
    },
    {
      "ObjectType": "FieldtoFieldMultiMapConfig",
      "WorkItemTypeName": "*",
      "SourceToTargetMappings": {
        "SourceField1": "TargetField1",
        "SourceField2": "TargetField2"
      }
    },
    {
      "ObjectType": "FieldtoTagMapConfig",
      "WorkItemTypeName": "*",
      "sourceField": "System.State",
      "formatExpression": "ScrumState:{0}"
    },
    {
      "ObjectType": "FieldMergeMapConfig",
      "WorkItemTypeName": "*",
      "sourceField1": "System.Description",
      "sourceField2": "Microsoft.VSTS.Common.AcceptanceCriteria",
      "targetField": "System.Description",
      "formatExpression": "{0} <br/><br/><h3>Acceptance Criteria</h3>{1}",
      "doneMatch": "##DONE##"
    },
    {
      "ObjectType": "RegexFieldMapConfig",
      "WorkItemTypeName": "*",
      "sourceField": "COMPANY.PRODUCT.Release",
      "targetField": "COMPANY.DEVISION.MinorReleaseVersion",
      "pattern": "PRODUCT \\d{4}.(\\d{1})",
      "replacement": "$1"
    },
    {
      "ObjectType": "FieldValuetoTagMapConfig",
      "WorkItemTypeName": "*",
      "sourceField": "Microsoft.VSTS.CMMI.Blocked",
      "pattern": "Yes",
      "formatExpression": "{0}"
    },
    {
      "ObjectType": "TreeToTagMapConfig",
      "WorkItemTypeName": "*",
      "toSkip": 3,
      "timeTravel": 1
    }
  ],
  "GitRepoMapping": null,
  "LogLevel": "Information",
  "Processors": [
    {
      "ObjectType": "WorkItemMigrationConfig",
      "ReplayRevisions": true,
      "PrefixProjectToNodes": false,
      "UpdateCreatedDate": true,
      "UpdateCreatedBy": true,
      "BuildFieldTable": false,
      "AppendMigrationToolSignatureFooter": false,
      "WIQLQueryBit": "AND  [Microsoft.VSTS.Common.ClosedDate] = '' AND [System.WorkItemType] NOT IN ('Test Suite', 'Test Plan')",
      "WIQLOrderBit": "[System.ChangedDate] desc",
      "Enabled": false,
      "LinkMigration": true,
      "AttachmentMigration": true,
      "AttachmentWorkingPath": "c:\\temp\\WorkItemAttachmentWorkingFolder\\",
      "FixHtmlAttachmentLinks": false,
      "SkipToFinalRevisedWorkItemType": false,
      "WorkItemCreateRetryLimit": 5,
      "FilterWorkItemsThatAlreadyExistInTarget": true,
      "PauseAfterEachWorkItem": false,
      "AttachmentMaxSize": 480000000,
      "CollapseRevisions": false,
      "LinkMigrationSaveEachAsAdded": false,
      "GenerateMigrationComment": true,
      "NodeBasePaths": [
        "Product\\Area\\Path1",
        "Product\\Area\\Path2"
      ],
      "WorkItemIDs": null
    },
    {
      "ObjectType": "TestVariablesMigrationConfig",
      "Enabled": false
    },
    {
      "ObjectType": "TestConfigurationsMigrationConfig",
      "Enabled": false
    },
    {
      "ObjectType": "TestPlansAndSuitesMigrationConfig",
      "PrefixProjectToNodes": false,
      "Enabled": false,
      "OnlyElementsWithTag": null,
      "TestPlanQueryBit": null,
      "RemoveInvalidTestSuiteLinks": false,
      "FilterCompleted": false
    },
    {
      "ObjectType": "ImportProfilePictureConfig",
      "Enabled": false
    },
    {
      "ObjectType": "ExportProfilePictureFromADConfig",
      "Domain": null,
      "Username": null,
      "Password": null,
      "PictureEmpIDFormat": null,
      "Enabled": false
    },
    {
      "ObjectType": "FixGitCommitLinksConfig",
      "TargetRepository": "targetProjectName",
      "Enabled": false,
      "QueryBit": null,
      "OrderBit": null
    },
    {
      "ObjectType": "WorkItemUpdateConfig",
      "WhatIf": false,
      "Enabled": false,
      "WIQLQueryBit": "AND [TfsMigrationTool.ReflectedWorkItemId] = '' AND  [Microsoft.VSTS.Common.ClosedDate] = '' AND [System.WorkItemType] IN ('Shared Steps', 'Shared Parameter', 'Test Case', 'Requirement', 'Task', 'User Story', 'Bug')",
      "WIQLOrderBit": null,
      "WorkItemIDs": null,
      "FilterWorkItemsThatAlreadyExistInTarget": false,
      "PauseAfterEachWorkItem": false,
      "WorkItemCreateRetryLimit": 0
    },
    {
      "ObjectType": "WorkItemPostProcessingConfig",
      "WorkItemIDs": [
        1,
        2,
        3
      ],
      "Enabled": false,
      "WIQLQueryBit": "AND [TfsMigrationTool.ReflectedWorkItemId] = '' ",
      "WIQLOrderBit": null,
      "FilterWorkItemsThatAlreadyExistInTarget": false,
      "PauseAfterEachWorkItem": false,
      "WorkItemCreateRetryLimit": 0
    },
    {
      "ObjectType": "WorkItemDeleteConfig",
      "Enabled": false,
      "WIQLQueryBit": "AND  [Microsoft.VSTS.Common.ClosedDate] = '' AND [System.WorkItemType] NOT IN ('Test Suite', 'Test Plan')",
      "WIQLOrderBit": "[System.ChangedDate] desc",
      "WorkItemIDs": null,
      "FilterWorkItemsThatAlreadyExistInTarget": false,
      "PauseAfterEachWorkItem": false,
      "WorkItemCreateRetryLimit": 0
    },
    {
      "ObjectType": "WorkItemQueryMigrationConfig",
      "PrefixProjectToNodes": false,
      "SharedFolderName": "Shared Queries",
      "SourceToTargetFieldMappings": {
        "SourceFieldRef": "TargetFieldRef"
      },
      "Enabled": false
    },
    {
      "ObjectType": "TeamMigrationConfig",
      "Enabled": false,
      "PrefixProjectToNodes": false,
      "EnableTeamSettingsMigration": true
    }
  ]
}