Notify Twilio: don't call the OOH Incident Manager if already on another callout call

 

'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'; }

Comments

Popular posts from this blog

GlideRecord setValue

variable advanced reference qualifier example

URL link in addInfoMessage