Skip to content

Commit 0cb8f8f

Browse files
authored
TfsWorkItemTypeValidatorTool: mapping field value to empty string is considered valid (#3019)
Fixes: #3013 If field value in `FieldValueMap` is mapped to empty string, this is considered valid. Empty values are not checked among allowed values in target.
2 parents c31abdc + 5fd3a03 commit 0cb8f8f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/MigrationTools.Clients.TfsObjectModel/Tools/TfsWorkItemTypeValidatorTool.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,14 @@ private bool ValidateAllowedValues(
370370
{
371371
if (valueMaps.TryGetValue(missingValue, out string mappedValue))
372372
{
373-
if (targetAllowedValues.Contains(mappedValue, StringComparer.OrdinalIgnoreCase))
373+
if (string.IsNullOrWhiteSpace(mappedValue))
374+
{
375+
mappedValues.Add(missingValue);
376+
Log.LogInformation(" Value '{missingValue}' is mapped to empty string ('{mappedValue}')."
377+
+ " This is not checked in target and considered valid.",
378+
missingValue, mappedValue);
379+
}
380+
else if (targetAllowedValues.Contains(mappedValue, StringComparer.OrdinalIgnoreCase))
374381
{
375382
mappedValues.Add(missingValue);
376383
Log.LogDebug(" Value '{missingValue}' is mapped to '{mappedValue}', which exists in target.",

0 commit comments

Comments
 (0)