Failed to process batch for class copadovsm.ValueStreamMapFieldHistoryBatchIf you are using Copado VSM, you might have received the error below:
Apex script unhandled exception by user/organization: 005XXXXXXXXXXXX/00DYYYYYYYYYYYY
Failed to process batch for class 'copadovsm.ValueStreamMapFieldHistoryBatch' for job id 'ZZZZZZZZZZZZZZZ'
caused by: copadovsm.AbstractCollector.EventException: Argument cannot be null.
Class.copadovsm.AbstractCollector.exceptionWithDetails: line 791, column 1
Class.copadovsm.AbstractCollector.exceptionWithDetails: line 777, column 1
Class.copadovsm.AbstractCollector.eventNewInstance: line 118, column 1
Class.copadovsm.FieldHistoryCollector: line 204, column 1
Class.copadovsm.FieldHistoryCollector: line 172, column 1
Class.copadovsm.FieldHistoryCollector: line 94, column 1
Class.copadovsm.FieldHistoryCollector: line 27, column 1
Class.copadovsm.ValueStreamMapFieldHistoryBatch: line 21, column 1
The root cause and resolution for this issue is the following:
Before the version 1.25, we were tracking unique operators automatically by using the OwnerId.
In VSM 1.25 we added an option (Operator Field) on the setup page to select the user look up to track as an operator for the work item but on the code base, for the backwards compatibility, the default is still OwnerId.
If the Operator Field is empty we still use the OwnerId, if not, we read the value from the field in the Operator Field.
The problem here is that the Operator Field is empty and we cannot use the OwnerId because child objects in Salesforce don't have OwnerId.
By adding the field CreatedById to the Operator Field and recalculating, the issue will be resolved.