Skip to content

Commit

Permalink
Update WitClientUtils.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander-Hjelm authored Aug 22, 2024
1 parent 335cd46 commit 86ad83c
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/WorkItemMigrator/WorkItemImport/WitClient/WitClientUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1059,10 +1059,16 @@ private void AddSingleLinkToWorkItemAndSave(WiLink link, WorkItem sourceWI, Work
}
}
},
JsonPatchDocUtils.CreateJsonFieldPatchOp(Operation.Add, WiFieldReference.ChangedBy, changedBy),
JsonPatchDocUtils.CreateJsonFieldPatchOp(Operation.Add, WiFieldReference.ChangedDate, changedDate)
};

if (!string.IsNullOrEmpty(changedBy))
{
linkPatchDocument.Add(
JsonPatchDocUtils.CreateJsonFieldPatchOp(Operation.Add, WiFieldReference.ChangedBy, changedBy)
);
}

if (sourceWI.Id.HasValue)
_witClientWrapper.UpdateWorkItem(linkPatchDocument, sourceWI.Id.Value, settings.SuppressNotifications);
else
Expand Down Expand Up @@ -1094,10 +1100,16 @@ private void RemoveSingleLinkFromWorkItemAndSave(WiLink link, WorkItem sourceWI,
Operation = Operation.Remove,
Path = "/relations/"+relIndex
},
JsonPatchDocUtils.CreateJsonFieldPatchOp(Operation.Add, WiFieldReference.ChangedBy, changedBy),
JsonPatchDocUtils.CreateJsonFieldPatchOp(Operation.Add, WiFieldReference.ChangedDate, changedDate)
};

if (!string.IsNullOrEmpty(changedBy))
{
linkPatchDocument.Add(
JsonPatchDocUtils.CreateJsonFieldPatchOp(Operation.Add, WiFieldReference.ChangedBy, changedBy)
);
}

if (sourceWI.Id.HasValue)
_witClientWrapper.UpdateWorkItem(linkPatchDocument, sourceWI.Id.Value, settings.SuppressNotifications);
else
Expand Down

0 comments on commit 86ad83c

Please sign in to comment.