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.

Notify if an incident is high priority and unassigned for 2 hour when it is not assigned to any grou

ServiceNow Use6
Tera Guru

Hi,

I tried, but the email is not triggering. I am using after business rule with insert update

 
(function executeRule(current, previous /*null when async*/) {

    // Notify if an incident is high priority and unassigned for 2 hour when it is not assigned to any group
   
        var gr = new GlideRecord('incident');
        gr.addEncodedQuery('sys_created_onBETWEENjavascript:gs.beginningOfLast2Hours()@javascript:gs.endOfCurrentMinute()^assignment_groupISEMPTY^priority=1');
        gr.query();
        while(gr.next()){

        gs.email('aileen.mottern@example.com', '', 'Aileen, assignment group is unassigned and the priority is 1', 'Aileen, assignment group is unassigned and the priority is 1');
    }
   

 

Regards

Suman P.

 

})(current, previous);
5 REPLIES 5

Hi @ServiceNow Use6 

BR will not work, mate, as there is no database action trigger. Use a Flow or Scheduled Job instead.

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************