'is escalatee' script:
//--https://tools.hmcts.net/jira/browse/ITSM-14117
var userSYSID = workflow.scratchpad.currentEscalateeId;
workflow.scratchpad.escalateecalloutcounter += 1;
workflow.info('wait for "user call finished" counter: ' + workflow.scratchpad.escalateecalloutcounter);
answer = ifScript_checkCalls(userSYSID, workflow.scratchpad.escalateecalloutcounter);
function ifScript_checkCalls(escalateeSYSID, loopCounter) {
if (loopCounter > 9) { //failsafe of 5mins
return 'no';
}
var grCalls = new GlideRecord('notify_participant');
grCalls.addActiveQuery();
grCalls.addQuery('user', escalateeSYSID);
grCalls.addEncodedQuery('sys_created_onONLast 30 minutes@javascript:gs.beginningOfLast30Minutes()@javascript:gs.endOfLast30Minutes()');
grCalls.query();
if (grCalls.getRowCount() > 0) {
return 'yes';
}
return 'no';
}
(ServiceNow )
(ServiceNow )
Comments
Post a Comment