Skip to content

Commit

Permalink
Update Agent.cs
Browse files Browse the repository at this point in the history
Alexander-Hjelm authored Jan 27, 2025
1 parent f356146 commit d0d3098
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/WorkItemMigrator/WorkItemImport/Agent.cs
Original file line number Diff line number Diff line change
@@ -662,6 +662,8 @@ private bool ApplyAndSaveLinks(WiRevision rev, WorkItem wi, Settings settings)
// If this revision already has any fields, defer the link import by 2 miliseconds. Otherwise the Work Items API will
// send the response: "VS402625: Dates must be increasing with each revision"
saveLinkTimestamp = saveLinkTimestamp.AddMilliseconds(2);
// This needs to be set so that ApplyFields gets a later date, later on in the revision import
wi.Fields[WiFieldReference.ChangedDate] = saveLinkTimestamp.AddMilliseconds(2);
}

for (int i = 0; i < rev.Links.Count; i++)
@@ -690,6 +692,8 @@ private bool ApplyAndSaveLinks(WiRevision rev, WorkItem wi, Settings settings)
// If this has multiple link updates, defer each ubsequent link import by 2 miliseconds.
// Otherwise the Work Items API will send the response: "VS402625: Dates must be increasing with each revision"
saveLinkTimestamp = saveLinkTimestamp.AddMilliseconds(2);
// This needs to be set so that ApplyFields gets a later date, later on in the revision import
wi.Fields[WiFieldReference.ChangedDate] = saveLinkTimestamp.AddMilliseconds(2);
}

if (link.Change == ReferenceChangeType.Added && !_witClientUtils.AddAndSaveLink(link, wi, settings, rev.Author, saveLinkTimestamp))

0 comments on commit d0d3098

Please sign in to comment.