diff --git a/src/WorkItemMigrator/WorkItemImport/ImportCommandLine.cs b/src/WorkItemMigrator/WorkItemImport/ImportCommandLine.cs index cdf9a4b5..388fb67a 100644 --- a/src/WorkItemMigrator/WorkItemImport/ImportCommandLine.cs +++ b/src/WorkItemMigrator/WorkItemImport/ImportCommandLine.cs @@ -119,15 +119,6 @@ private bool ExecuteMigration(CommandOption token, CommandOption url, CommandOpt continue; } - if (config.IgnoreEmptyRevisions && - executionItem.Revision.Fields.Count == 0 && - executionItem.Revision.Links.Count == 0 && - executionItem.Revision.Attachments.Count == 0) - { - Logger.Log(LogLevel.Info, $"Skipped processing empty revision: {executionItem.OriginId}, rev {executionItem.Revision.Index}"); - continue; - } - WorkItem wi = null; if (executionItem.WiId > 0) @@ -137,9 +128,19 @@ private bool ExecuteMigration(CommandOption token, CommandOption url, CommandOpt Logger.Log(LogLevel.Info, $"Processing {importedItems + 1}/{revisionCount} - wi '{(wi.Id > 0 ? wi.Id.ToString() : "Initial revision")}', jira '{executionItem.OriginId}, rev {executionItem.Revision.Index}'."); - agent.ImportRevision(executionItem.Revision, wi, settings); importedItems++; + if (config.IgnoreEmptyRevisions && + executionItem.Revision.Fields.Count == 0 && + executionItem.Revision.Links.Count == 0 && + executionItem.Revision.Attachments.Count == 0) + { + Logger.Log(LogLevel.Info, $"Skipped processing empty revision: {executionItem.OriginId}, rev {executionItem.Revision.Index}"); + continue; + } + + agent.ImportRevision(executionItem.Revision, wi, settings); + // Artifical wait (optional) to avoid throttling for ADO Services if (config.SleepTimeBetweenRevisionImportMilliseconds > 0) {