The Zurich release has arrived! Interested in new features and functionalities? Click here for more

How to send the notification

Alex78
Tera Contributor

Hi team,

 

How to send the notification when ritm approval is approved state and type is draft stage then send the notification for every week?

1 ACCEPTED SOLUTION

Anand Kumar P
Giga Patron
Giga Patron

Hi @Alex78 ,

You can create schedule job that will run on weekly and add below script and create one event and call that event notification and schedule job.

  var ritmGr = new GlideRecord('sc_req_item');
    ritmGr.addQuery('approval', 'approved');
//you can addQuery for specific item to trigger notification
    ritmGr.addQuery('stage', 'draft');
    ritmGr.query();
    while (ritmGr.next()) {
      gs.eventQueue('eventname',gr,param1,param2);
    }

Check below link how to create schedule job notification and event
https://www.servicenow.com/community/developer-forum/creating-schedule-job-to-send-notification/m-p/... 


Please mark it as helpful and solution proposed if it serves your purpose.

Thanks,

Anand

View solution in original post

1 REPLY 1

Anand Kumar P
Giga Patron
Giga Patron

Hi @Alex78 ,

You can create schedule job that will run on weekly and add below script and create one event and call that event notification and schedule job.

  var ritmGr = new GlideRecord('sc_req_item');
    ritmGr.addQuery('approval', 'approved');
//you can addQuery for specific item to trigger notification
    ritmGr.addQuery('stage', 'draft');
    ritmGr.query();
    while (ritmGr.next()) {
      gs.eventQueue('eventname',gr,param1,param2);
    }

Check below link how to create schedule job notification and event
https://www.servicenow.com/community/developer-forum/creating-schedule-job-to-send-notification/m-p/... 


Please mark it as helpful and solution proposed if it serves your purpose.

Thanks,

Anand