0

我们需要将特定团队(在区域路径 X 下)的选定工作项类型从本地 TFS 服务器迁移到 Azure DevOps。我们尝试将QueryBitBasePaths设置为源区域路径,但没有成功过滤团队的工作项。

  • 我们应该使用QueryBit还是BasePaths,或者两者都使用?
  • 是否有任何示例配置文件可用作快速入门或参考?

我们已经看了几次概述视频,并努力寻找相关文档。

4

1 回答 1

1

您应该使用 QueryBit 将工作项范围限定为您想要的。对于团队,您应该查看该团队拥有的特定区域路径的范围。

最新版本在 SampleConfigs 文件夹中有一些示例配置(并非全部在日期)供参考。

例如

{
  "Version": "0.0",
  "TelemetryEnableTrace": false,
  "workaroundForQuerySOAPBugEnabled": false,
  "ChangeSetMappingFile": null,
  "Source": {
    "Collection": "https://dev.azure.com/nkdagility-preview/",
    "Project": "migrationSource1",
    "ReflectedWorkItemIDFieldName": "Custom.ReflectedWorkItemId",
    "AllowCrossProjectLinking": false,
    "PersonalAccessToken": "",
    "LanguageMaps": {
      "AreaPath": "Area",
      "IterationPath": "Iteration"
    }
  },
  "Target": {
    "Collection": "https://dev.azure.com/nkdagility-preview/",
    "Project": "migrationTarget1",
    "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
    }
  ],
  "WorkItemTypeDefinition": { "sourceWorkItemTypeName": "targetWorkItemTypeName" },
  "GitRepoMapping": null,
  "Processors": [
    {
      "ObjectType": "NodeStructuresMigrationConfig",
      "PrefixProjectToNodes": false,
      "Enabled": false,
      "BasePaths": [ "Product\\Area\\Path1", "Product\\Area\\Path2" ]
    },
    {
      "ObjectType": "WorkItemMigrationConfig",
      "ReplayRevisions": true,
      "PrefixProjectToNodes": false,
      "UpdateCreatedDate": true,
      "UpdateCreatedBy": true,
      "BuildFieldTable": false,
      "AppendMigrationToolSignatureFooter": false,
      "QueryBit": "AND  [Microsoft.VSTS.Common.ClosedDate] = '' AND [System.WorkItemType] NOT IN ('Test Suite', 'Test Plan')",
      "OrderBit": "[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
    },
    {
      "ObjectType": "TestVariablesMigrationConfig",
      "Enabled": false
    },
    {
      "ObjectType": "TestConfigurationsMigrationConfig",
      "Enabled": false
    },
    {
      "ObjectType": "TestPlansAndSuitesMigrationConfig",
      "PrefixProjectToNodes": false,
      "Enabled": false,
      "OnlyElementsWithTag": null,
      "TestPlanQueryBit": null,
      "RemoveInvalidTestSuiteLinks": false
    },
    {
      "ObjectType": "ImportProfilePictureConfig",
      "Enabled": false
    },
    {
      "ObjectType": "ExportProfilePictureFromADConfig",
      "Domain": null,
      "Username": null,
      "Password": null,
      "PictureEmpIDFormat": null,
      "Enabled": false
    },
    {
      "ObjectType": "FixGitCommitLinksConfig",
      "TargetRepository": "migrationTarget1",
      "Enabled": false,
      "QueryBit": null,
      "OrderBit": null
    },
    {
      "ObjectType": "WorkItemUpdateConfig",
      "WhatIf": false,
      "QueryBit": "AND [TfsMigrationTool.ReflectedWorkItemId] = '' AND  [Microsoft.VSTS.Common.ClosedDate] = '' AND [System.WorkItemType] IN ('Shared Steps', 'Shared Parameter', 'Test Case', 'Requirement', 'Task', 'User Story', 'Bug')",
      "Enabled": false
    },
    {
      "ObjectType": "WorkItemPostProcessingConfig",
      "QueryBit": "AND [TfsMigrationTool.ReflectedWorkItemId] = '' ",
      "WorkItemIDs": [ 1, 2, 3 ],
      "Enabled": false
    },
    {
      "ObjectType": "WorkItemDeleteConfig",
      "Enabled": false
    },
    {
      "ObjectType": "WorkItemQueryMigrationConfig",
      "PrefixProjectToNodes": false,
      "SharedFolderName": "Shared Queries",
      "SourceToTargetFieldMappings": { "SourceFieldRef": "TargetFieldRef" },
      "Enabled": false
    },
    {
      "ObjectType": "TeamMigrationConfig",
      "Enabled": false,
      "PrefixProjectToNodes": false,
      "EnableTeamSettingsMigration": true
    }
  ]
}

主要工作是 WorkItemMigrationConfig,其中包含QueryBit.

    {
      "ObjectType": "WorkItemMigrationConfig",
      "ReplayRevisions": true,
      "PrefixProjectToNodes": false,
      "UpdateCreatedDate": true,
      "UpdateCreatedBy": true,
      "BuildFieldTable": false,
      "AppendMigrationToolSignatureFooter": false,
      "QueryBit": "AND  [Microsoft.VSTS.Common.ClosedDate] = '' AND [System.WorkItemType] NOT IN ('Test Suite', 'Test Plan')",
      "OrderBit": "[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
    },

这个特定的查询位是我的 goto 默认值,不包括已关闭的项目和测试套装和计划。

"QueryBit": "AND [Microsoft.VSTS.Common.ClosedDate] = '' AND [System.WorkItemType] NOT IN ('Test Suite', 'Test Plan')"

要将范围仅限于团队,您可以使用:

"QueryBit": "AND [System.Area] = '\MyTeamName' AND [System.WorkItemType] NOT IN ('Test Suite', 'Test Plan')"

于 2020-09-29T21:45:34.360 回答