Skip to content

Commit

Permalink
Merge pull request #1095 from solidify/bugfix/delay-items-with-both-f…
Browse files Browse the repository at this point in the history
…ields-and-revisions

Ensure that items with both Fields and Links are delayed prior to the field import
  • Loading branch information
Alexander-Hjelm authored Jan 27, 2025
2 parents f356146 + d0d3098 commit 4e30445
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
Expand Up @@ -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++)
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit 4e30445

Please sign in to comment.