Approval Reminder
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-07-2023 08:01 PM
- Create a notification that will remind the approver of an unapproved RITM (Note that you can reuse existing RITMs that satisfies the condition no need to create new catalog item or request a new RITM)
- Create a scheduled job that will trigger the notification created above daily but will not run if the current date is out of schedule (8-5 weekdays)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-21-2024 06:37 AM
Sure! In most or all examples, the reminder is sent to the approver added in a request, or in a RITM. However, I wish to send notifications to the approver added in the SCTASK. When you create a request and you dont require an approver, a RITM will be created, and the RITM will create its SCTASK. In the SCTASK there is an "approvers" column, where you can add an approver. I would like to send notifications to this person.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-22-2024 07:58 AM
Sure! I will try to explain:
The only thing missing that im not being able to do, is select as recipient(who will receive), the person added as an approver in the SCTASK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-09-2023 11:05 PM
but what can i do if i only want RITM data to be called
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-09-2023 11:45 PM
On sysapproval_approver table we have column as 'Source Table'
You can add a query in your scheduled job for Source table = Requested Item (sc_req_item)
gr.addEncodedQuery('state=requested^source_table=sc_req_item'); //customized query
/* Get Day of week */
var date = new GlideDateTime();
var day = date.getDayOfWeek();
/* if not saturday & sunday then run the script */
if (day != 6 || day != 7) {
/* Get Schedule */
var shcd = new GlideSchedule('08fcd0830a0a0b2600079f56b1adb9ae'); //sys_id of schedule
/*Check if date is not in schedule*/
if (!shcd.isInSchedule(date)) {
/* Glide record on 'sysapproval_approver' table */
var gr = new GlideRecord("sysapproval_approver");
gr.addEncodedQuery('state=requested^source_table=sc_req_item'); //customized query
gr.query();
while (gr.next()) {
/*Send the reminder */
gs.eventQueue('approval.reminder', gr);
}
}else {
gs.log('Date is in schedule');
}
}
Hope this helps...!!!
ServiceNow Developer
I know one thing, and that is that I know nothing.
- Socrates
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-10-2023 12:19 AM
where did u get the sys id of the schedule?