Skip to content

Commit

Permalink
Merge branch 'main' into topic/exception-enhancement
Browse files Browse the repository at this point in the history
  • Loading branch information
MrHinsh committed Oct 3, 2024
2 parents df545d9 + 6294190 commit 275bec8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
12 changes: 12 additions & 0 deletions configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,12 @@ public void MapUserIdentityField(TfsProcessor processor, Field field)

private Dictionary<string, string> 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<string, string>();
}
if (_UserMappings == null)
{
var fileData = System.IO.File.ReadAllText(Options.UserMappingFile);
try
Expand All @@ -101,14 +106,7 @@ private Dictionary<string, string> GetMappingFileData()
}

}
else
{
Log.LogError($"TfsUserMappingTool::GetMappingFileData::No User Mapping file Provided! Provide file or disable TfsUserMappingTool");
_UserMappings = new Dictionary<string, string>();
}

return _UserMappings;

}

private List<IdentityItemData> GetUsersListFromServer(IGroupSecurityService gss)
Expand Down

0 comments on commit 275bec8

Please sign in to comment.