Skip to content

Commit

Permalink
TF26027: A field definition Microsoft.VSTS.Common.ClosedDate in the w…
Browse files Browse the repository at this point in the history
…ork 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
-
  • Loading branch information
MrHinsh authored Oct 22, 2024
2 parents 459d674 + 80e037c commit 6a6e0e2
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -419,12 +419,12 @@ private void PopulateWorkItem(WorkItemData oldWorkItemData, WorkItemData newWork
}

newWorkItem.Title = oldWorkItem.Title;
if (newWorkItem.Fields["Microsoft.VSTS.Common.ClosedDate"].IsEditable)
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;
}
newWorkItem.State = oldWorkItem.State;
if (newWorkItem.Fields["Microsoft.VSTS.Common.ClosedDate"].IsEditable)
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;
}
Expand Down

0 comments on commit 6a6e0e2

Please sign in to comment.