I have a server plugin which is using the WorkItemChangedEventHandler to process the workitems for some specific cases. The TFS instance has 3 different collections.
For a specific collection the GetWorkItem method is throwing an exception with the An item with the same key has already been added.
message and it stops the further execution.
WorkItemChangedEvent workItemChange = (WorkItemChangedEvent)notificationEventArgs;
WorkItemStore store = Utils.GetWorkItemStore(requestContext);
IntegerField field = workItemChange.CoreFields.IntegerFields[0];
int workitemId = field.NewValue;
store.GetWorkItem(workitemId);
I'm using TFS2017 Update 2.