Skip to content

Commit 4e30445

Browse files
Merge pull request #1095 from solidify/bugfix/delay-items-with-both-fields-and-revisions
Ensure that items with both Fields and Links are delayed prior to the field import
2 parents f356146 + d0d3098 commit 4e30445

File tree

1 file changed

+4
-0
lines changed
  • src/WorkItemMigrator/WorkItemImport

1 file changed

+4
-0
lines changed

src/WorkItemMigrator/WorkItemImport/Agent.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -662,6 +662,8 @@ private bool ApplyAndSaveLinks(WiRevision rev, WorkItem wi, Settings settings)
662662
// If this revision already has any fields, defer the link import by 2 miliseconds. Otherwise the Work Items API will
663663
// send the response: "VS402625: Dates must be increasing with each revision"
664664
saveLinkTimestamp = saveLinkTimestamp.AddMilliseconds(2);
665+
// This needs to be set so that ApplyFields gets a later date, later on in the revision import
666+
wi.Fields[WiFieldReference.ChangedDate] = saveLinkTimestamp.AddMilliseconds(2);
665667
}
666668

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

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

0 commit comments

Comments
 (0)