Skip to content

[Bug]: in AllowedValuesAreSame method, from class tfsWorkItemTypeValidatorTool.cs , should check if target field count is less than sourcefield count #2952

@kapilkhub

Description

@kapilkhub

Version

  • I confirm that I am using the latest version

Source Version

Azure DevOps Service

Target Version

Azure DevOps Service

Relevant configuration

{
    "Serilog": {
        "MinimumLevel": "Information"
    },
    "MigrationTools": {
        "Version": "16.0",
        "Endpoints": {
            "Source": {
                "EndpointType": "TfsTeamProjectEndpoint",
                "Collection": "http://source/CollectionA/",
                "Project": "xxxx",
                "AllowCrossProjectLinking": false,
                "ReflectedWorkItemIdField": "Custom.ReflectedWorkItemId",
                "Authentication": {
                    "AuthenticationMode": "Prompt",
                    "AccessToken": "",
                    "NetworkCredentials": {
                        "Domain": "xxxxx",
                        "UserName": "xxxxxx",
                        "Password": "xxxxxxx"
                    }
                },
                "LanguageMaps": {
                    "AreaPath": "Area",
                    "IterationPath": "Iteration"
                }
            },
            "Target": {
                "EndpointType": "TfsTeamProjectEndpoint",
                "Collection": "https://target/CollectionB/",
                "Project": "xxxxx",
                "TfsVersion": "AzureDevOps",
                "Authentication": {
                    "AuthenticationMode": "Prompt",
                    "AccessToken": "",
                    "NetworkCredentials": {
                        "Domain": "xxxxx",
                        "UserName": "xxxxxx",
                        "Password": "xxxxxx"
                    }
                },
                "ReflectedWorkItemIdField": "Custom.ReflectedWorkItemId",
                "AllowCrossProjectLinking": false,
                "LanguageMaps": {
                    "AreaPath": "Area",
                    "IterationPath": "Iteration"
                }
            }
        },
        "Processors": [
            {
                "ProcessorType": "TfsWorkItemMigrationProcessor",
                "Enabled": true,
                "UpdateCreatedDate": true,
                "UpdateCreatedBy": true,
                "WIQLQuery": "SELECT [System.Id] FROM WorkItems WHERE [System.TeamProject] = @TeamProject AND [Iteration Path] = 'xxxx\\Aug_2025'  AND [System.WorkItemType] NOT IN ('Test Suite', 'Test Plan','Shared Steps','Shared Parameter','Feedback Request','Code Review Request','Code Review Response','Feedback Response') ORDER BY [System.ChangedDate] desc",
                "FixHtmlAttachmentLinks": false,
                "WorkItemCreateRetryLimit": 10,
                "FilterWorkItemsThatAlreadyExistInTarget": true,
                "PauseAfterEachWorkItem": false,
                "AttachRevisionHistory": false,
                "GenerateMigrationComment": true,
                "SourceName": "Source",
                "TargetName": "Target",
                "MaxGracefulFailures": 0,
                "SkipRevisionWithInvalidIterationPath": false,
                "SkipRevisionWithInvalidAreaPath": false
            }
        ],
        "CommonTools": {
            "TfsWorkItemTypeValidatorTool": {
                "Enabled": true,
                "IncludeWorkItemtypes": [
                    "Bug",
                    "Epic",
                    "Feature",
                    "Task",
                    "Test Case",
                    "Test Plan",
                    "Test Suite",
                    "User Story",
                    "Issue",
                    "Release",
                    "UAT Comment",
                    "Business Rule",
                    "Incident",
                    "Legacy Item",
                    "Spike",
                    "Public Holiday",
                    "Project Activity",
                    "Risk",
                    "Service Request",
                    "Technical Activity",
                    "Leave"
                ]
            }

        }
    }
}

Relevant log output

[14:49:37 INF] [16.2.11] Validating work item type 'User Story'
[14:49:38 WRN] [16.2.11]   Source field 'Microsoft.VSTS.Common.ResolvedReason' and target field 'Microsoft.VSTS.Common.ResolvedReason' have different allowed values.
[14:49:38 INF] [16.2.11]     Source allowed values: 'As Designed', 'Cannot Reproduce', 'Copied to Backlog', 'Deferred', 'Duplicate', 'Fixed', 'Fixed and verified', 'Obsolete'
[14:49:38 INF] [16.2.11]     Target allowed values: 'As Designed', 'Cannot Reproduce', 'Copied to Backlog', 'Deferred', 'Duplicate', 'Fixed', 'Fixed and verified', 'Obsolete', 'Will not Fix'

What happened?

A bug happened!

When trying to migrate from Azure Devops 2019 to Azure Devops 2022, in user story , Resolved reason which is of type Microsoft.VSTS.Common.ResolvedReason , has extra value "Will not fix" in target values.

in source code, we are checking if source field count and target field count are not equal then we are returning false.

instead, we should check if targetfields.count< sourcefields.count

Debug in Visual Studio

  • Visual Studio Debug

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions