Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

SAM Zoom integration scheduled job error "Cannot read property "message" from undefined"

User523129
Tera Contributor

I have created a Zoom integration profile & I see it runs 2 daily scheduled jobs. One to download events & the other to download subscriptions. I noticed the download subscriptions job fails every time with a "Cannot read property "message" from undefined" error. Would anyone happen to know what this means? i don't know where to begin to look. It does have an OAuth token & is pulling in the user subscriptions but some of these users "Last activity" is empty.

8 REPLIES 8

Churchie73
Tera Contributor

I am seeing the same thing.
I suspect there is an empty field or data type mismatch that the script can not process.
If I find out more I will reply back.

Please do! I still haven't been able to figure it out.

I have a workaround for this that is allowing the job to finish in our instances.
Basically for us there was a job that was not completing when what i suspect was a problem user record in the Zoom portal.
In a script include named "SAMSaasZoomIntegration", the function 

_insertWebinarSubscriptions was not completing on one of the calls in the for loop for userId in subscriptionMap.
The workaround for me was to put the code in a try catch. 
There are other functions that get called in this script include. For example, _insertSubscriptions.
I plan to put these functions that are running loops of executions into try catch blocks where they aren't already.

Note this article [KB0959651] from ServiceNow where they call this out it a vague round about way.
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0959651


See my updated problem function below for an example:
_insertWebinarSubscriptions: function(apiClient) {
var subscriptionMap = this._getZoomSubscriptions(this.profileGr.getUniqueValue());
if (gs.nil(subscriptionMap)) {
return;
}
try {
for (var userId in subscriptionMap) {
var userSettingResponse = this._getUserSetting(apiClient, userId);
var isWebinarEnabled = userSettingResponse.feature.hasOwnProperty('webinar') ? userSettingResponse.feature.webinar : null;
if (isWebinarEnabled) {
var licenseType = 'WEBINAR';
if (Object.prototype.hasOwnProperty.call(this.PPN_MAP, licenseType)) {
this.SAMSaasSubscriptionUtils.createSubscriptionRecord(
subscriptionMap[userId].upn,
this.PPN_MAP[licenseType],
this.profileGr.getUniqueValue(),
userId,
subscriptionMap[userId].externalCreated, {}, {
updateLastActivityOnSoftwareModelChange: true,
excludeSubscriptionIdentifierFilter: true,
nonSLCMultipleProducts: true,
}
);
}
}
this.SAMSaasSubscriptionUtils.updateNumberOfUnrecognizedSubscription();
}
} catch (e) {
gs.info('Zoom catch error in _insertWebinarSubscriptions');
}
}


Thank you! I tried this and the scheduled job was completed but it also deleted the zoom webinar software model & all the users it had discovered under that model. Did you experience this?