Skip to content

Commit d959f09

Browse files
Log a warning if the Microsoft.VSTS.TCM.Steps field does not exist on the source work item.
1 parent 498f182 commit d959f09

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/MigrationTools.Clients.TfsObjectModel/Processors/TfsWorkItemMigrationProcessor.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,14 @@ private void PopulateWorkItem(WorkItemData oldWorkItemData, WorkItemData newWork
533533
switch (destType)
534534
{
535535
case "Test Case":
536-
newWorkItem.Fields["Microsoft.VSTS.TCM.Steps"].Value = oldWorkItem.Fields["Microsoft.VSTS.TCM.Steps"].Value;
536+
try
537+
{
538+
newWorkItem.Fields["Microsoft.VSTS.TCM.Steps"].Value = oldWorkItem.Fields["Microsoft.VSTS.TCM.Steps"].Value;
539+
}
540+
catch (Exception e)
541+
{
542+
Log.LogWarning("Microsoft.VSTS.TCM.Steps does not exist on Source Work Item. This field will be skipped, but the all other fields on the revision will be populated.");
543+
}
537544
newWorkItem.Fields["Microsoft.VSTS.Common.Priority"].Value =
538545
oldWorkItem.Fields["Microsoft.VSTS.Common.Priority"].Value;
539546
break;

0 commit comments

Comments
 (0)