Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: null value in FieldValueMap is not handled #2595

Closed
2 tasks done
sbouchexbellomie-Philips opened this issue Jan 21, 2025 · 0 comments
Closed
2 tasks done

[Bug]: null value in FieldValueMap is not handled #2595

sbouchexbellomie-Philips opened this issue Jan 21, 2025 · 0 comments
Labels

Comments

@sbouchexbellomie-Philips

Version

  • I confirm that I am using the latest version

Source Version

Azure DevOps Service

Target Version

Azure DevOps Server 2022

Relevant configuration

FieldMappingTool is configured with the following :

...

      "FieldMappingTool": {
        "Enabled": true,
        "FieldMaps": [
          {
            "FieldMapType": "FieldValueMap",
            "sourceField": "Microsoft.VSTS.Common.Severity",
            "targetField": "Microsoft.VSTS.Common.Severity",
            "defaultValue": null,
            "valueMapping": {
              "1 - Blocker": "1 - Blocker",
              "2 - Major": "2 - Major",
              "3 - Moderate": "3 - Moderate",
              "4 - Minor": "4 - Minor"
            },
            "ApplyTo": ["Bug"]
          }

...

Relevant log output

[17:51:56 DBG] [16.0.9] Running Field Map: FieldValueMap Microsoft.VSTS.Common.Priority Aaa.Rank
[17:51:56 ERR] [16.0.9] Field map fault
System.NullReferenceException: La référence d'objet n'est pas définie à une instance d'un objet.
   à MigrationTools.FieldMaps.AzureDevops.ObjectModel.FieldValueMap.InternalExecute(WorkItemData source, WorkItemData target) dans D:\a\azure-devops-migration-tools\azure-devops-migration-tools\src\MigrationTools.Clients.TfsObjectModel\Tools\FieldMappingTool\FieldMaps\FieldValueMap.cs:ligne 41
   à MigrationTools.FieldMaps.AzureDevops.ObjectModel.FieldMapBase.Execute(WorkItemData source, WorkItemData target) dans D:\a\azure-devops-migration-tools\azure-devops-migration-tools\src\MigrationTools.Clients.TfsObjectModel\Tools\FieldMappingTool\FieldMaps\FieldMapBase.cs:ligne 35
Error logged to Elmah.io!
!! Check for latest version - We fix issues constantly - If not, please create a discussion on https://github.com/nkdAgility/azure-devops-migration-tools/discussions so we can get this fixed !!

What happened?

For some historical reason, the value Microsoft.VSTS.Common.Priority is set to null for a revision, and the null value is not handled by the FieldValueMap class

null must be handled and treated as "null"

Debug in Visual Studio

  • Visual Studio Debug
@MrHinsh MrHinsh removed the triage label Jan 27, 2025
sbouchex added a commit to sbouchex/azure-devops-migration-tools that referenced this issue Jan 28, 2025
MrHinsh added a commit that referenced this issue Jan 28, 2025
#2596 2595 Added null value handling and use the same behaviour as for
"null"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

No branches or pull requests

2 participants