Skip to content

Commit 6a6e0e2

Browse files
authored
TF26027: A field definition Microsoft.VSTS.Common.ClosedDate in the work item type definition file does not exist. (#2455)
Some work items do not have this field... Updated to: ``` if (newWorkItem.Fields.Contains("Microsoft.VSTS.Common.ClosedDate") && newWorkItem.Fields["Microsoft.VSTS.Common.ClosedDate"].IsEditable) { newWorkItem.Fields["Microsoft.VSTS.Common.ClosedDate"].Value = oldWorkItem.Fields["Microsoft.VSTS.Common.ClosedDate"].Value; } ``` Related Disucssions: - #2086 -
2 parents 459d674 + 80e037c commit 6a6e0e2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,12 +419,12 @@ private void PopulateWorkItem(WorkItemData oldWorkItemData, WorkItemData newWork
419419
}
420420

421421
newWorkItem.Title = oldWorkItem.Title;
422-
if (newWorkItem.Fields["Microsoft.VSTS.Common.ClosedDate"].IsEditable)
422+
if (newWorkItem.Fields.Contains("Microsoft.VSTS.Common.ClosedDate") && newWorkItem.Fields["Microsoft.VSTS.Common.ClosedDate"].IsEditable)
423423
{
424424
newWorkItem.Fields["Microsoft.VSTS.Common.ClosedDate"].Value = oldWorkItem.Fields["Microsoft.VSTS.Common.ClosedDate"].Value;
425425
}
426426
newWorkItem.State = oldWorkItem.State;
427-
if (newWorkItem.Fields["Microsoft.VSTS.Common.ClosedDate"].IsEditable)
427+
if (newWorkItem.Fields.Contains("Microsoft.VSTS.Common.ClosedDate") && newWorkItem.Fields["Microsoft.VSTS.Common.ClosedDate"].IsEditable)
428428
{
429429
newWorkItem.Fields["Microsoft.VSTS.Common.ClosedDate"].Value = oldWorkItem.Fields["Microsoft.VSTS.Common.ClosedDate"].Value;
430430
}

0 commit comments

Comments
 (0)