diff --git a/configuration.json b/configuration.json index 1189db046..065a41e21 100644 --- a/configuration.json +++ b/configuration.json @@ -132,6 +132,18 @@ "UpdateTeamSettings": true, "MigrateTeamCapacities": true, "Teams": [ "Team 1", "Team 2" ] + }, + "TfsUserMappingTool": { + "Enabled": true, + "UserMappingFile": "C:\\temp\\userExport.json", + "IdentityFieldsToCheck": [ + "System.AssignedTo", + "System.ChangedBy", + "System.CreatedBy", + "Microsoft.VSTS.Common.ActivatedBy", + "Microsoft.VSTS.Common.ResolvedBy", + "Microsoft.VSTS.Common.ClosedBy" + ] } }, "Processors": [ diff --git a/docs/Reference/Generated/MigrationTools.xml b/docs/Reference/Generated/MigrationTools.xml index 1f71e8ec5..8b9e5a253 100644 --- a/docs/Reference/Generated/MigrationTools.xml +++ b/docs/Reference/Generated/MigrationTools.xml @@ -263,17 +263,17 @@ - => @"cf9e4445" + => @"23fae28b" - => @"cf9e4445856c9cb732b3bcc438d2d3fc23b3fa23" + => @"23fae28bfbd54ac74475334e64dc733a9fd28131" - => @"2024-09-23T16:40:10+01:00" + => @"2024-09-24T15:02:38+01:00" @@ -283,12 +283,12 @@ - => @"v16.0.4-Preview.4-4-gcf9e4445" + => @"v16.0.4-Preview.5-4-g23fae28b" - => @"v16.0.4-Preview.4" + => @"v16.0.4-Preview.5" @@ -323,12 +323,12 @@ - => @"Preview.4" + => @"Preview.5" - => @"-Preview.4" + => @"-Preview.5" diff --git a/src/MigrationTools.Clients.TfsObjectModel/Tools/TfsUserMappingTool.cs b/src/MigrationTools.Clients.TfsObjectModel/Tools/TfsUserMappingTool.cs index 3570828ce..49559daad 100644 --- a/src/MigrationTools.Clients.TfsObjectModel/Tools/TfsUserMappingTool.cs +++ b/src/MigrationTools.Clients.TfsObjectModel/Tools/TfsUserMappingTool.cs @@ -86,7 +86,12 @@ public void MapUserIdentityField(TfsProcessor processor, Field field) private Dictionary GetMappingFileData() { - if (_UserMappings == null && System.IO.File.Exists(Options.UserMappingFile)) + if (!System.IO.File.Exists(Options.UserMappingFile)) + { + Log.LogError("TfsUserMappingTool::GetMappingFileData:: The UserMappingFile '{UserMappingFile}' cant be found! Provide a valid file or disable TfsUserMappingTool!", Options.UserMappingFile); + _UserMappings = new Dictionary(); + } + if (_UserMappings == null) { var fileData = System.IO.File.ReadAllText(Options.UserMappingFile); try @@ -101,14 +106,7 @@ private Dictionary GetMappingFileData() } } - else - { - Log.LogError($"TfsUserMappingTool::GetMappingFileData::No User Mapping file Provided! Provide file or disable TfsUserMappingTool"); - _UserMappings = new Dictionary(); - } - return _UserMappings; - } private List GetUsersListFromServer(IGroupSecurityService gss)