schedule job - servicenow

Venkumahant
Tera Contributor

hi Everyone,

i have a schedule job which triggers mail notification when the outbound queue reaches its limit . But this notification alert should be sent to teams , is that possible ? please help me 

 

schedule job script , FYI :-

(function executeRule() {
    var threshold = 20;  
    var gr = new GlideRecord('ecc_queue');
    gr.addEncodedQuery("agent=ESM Integration^state!=processed");
    gr.query();

    var count = gr.getRowCount();

    if (count > threshold) {
       
        gs.eventQueue('ecc_queue.threshold.exceeded-pavan', null, count);
        gs.info("ECC Queue Alert: Outbound Queue Threshold Exceeded. Current count: " + count);
    }
})();
6 REPLIES 6

J Siva
Tera Sage

HI @Venkumahant 
So you want to trigger the notification to the groups right.
You can use below line to trigger notifications to the group DL.

gs.eventQueue('<event name>,current,<group email id>,count);

In the notification record, under "Who will receive" section check the "Event param 1 contains recipient" check box.

JSiva_0-1741178349251.png

 

i want the notification to be triggered in Microsoft teams

J Siva
Tera Sage

Ok. You can achieve that in multiple ways. One through ServiceNow - MS teams integration. Which requires IntegrationHub subscription. The other way, create one bot account with mail id and trigger all the emails to the bot mail id. Then using power automate filter the emails and push the notification content to MS team groups.

We have implemented the same to notify the teams on SLA thresholds

can you brief the second step?