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

User mapping logic error #2417

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
14 changes: 7 additions & 7 deletions docs/Reference/Generated/MigrationTools.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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
Loading