Skip to content

Commit

Permalink
Merge pull request #1015 from solidify/bugfix/fix-for-array-fields-on…
Browse files Browse the repository at this point in the history
…-initial-revision

Ensure that array-type fields are migrated if they are only set on the initial revision
  • Loading branch information
Alexander-Hjelm authored Apr 11, 2024
2 parents 830e18a + aa1a01d commit 0896f88
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/WorkItemMigrator/JiraExport/JiraItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,14 @@ private static Dictionary<string, object> ExtractFields(string key, JObject remo
{
value = string.Join(";", prop.Value.Select(st => st.ExValue<string>("$.name")).ToList());
if (Regex.Match((string)value, "^[;]+$", RegexOptions.None, TimeSpan.FromMilliseconds(100)).Success || (string)value == "")
{
value = string.Join(";", prop.Value.Select(st => st.ExValue<string>("$.value")).ToList());
}
if(value.ToString().All(c => c == ';'))
{
// Failsafe if all other checks results in an array with correct length but empty elements
value = string.Join(";", prop.Value.Children().ToList());
}
}
else if (type == Newtonsoft.Json.Linq.JTokenType.Object && prop.Value["value"] != null)
{
Expand Down

0 comments on commit 0896f88

Please sign in to comment.