- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2024 09:23 PM
we have created events scheduled jobs and notiffication for request appoval notification on daily bases but the code is not working could you please suggest.
Event:
Scheduled jobs:
var app = new GlideRecord('sysapproval_approver');
app.addQuery('state','requested');
app.addQuery('sysapproval.sys_class_name', 'sc_request');
app.addEncodedQuery('sys_updated_onRELATIVELE@dayofweek@ago@1');
while(app.next()){
gs.eventQueue('sc.request.approval.reminder', app, app.approver, app.approver.getUserName());
app.update();
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2024 09:54 PM - edited 01-29-2024 09:55 PM
@Vani14 ,
Seems you have Included Incorrect Event in the Script and also need some changes in script , have updated the Script , can you please try with this
var app = new GlideRecord('sysapproval_approver');
app.addQuery('state','requested');
app.addQuery('source_table', 'sc_request');
app.addQuery('sys_created_onRELATIVELE@dayofweek@ago@1'); // it should be created on not updated on
app.orderBy('approver');
app.query();
var count = app.getRowCount();
while(app.next()){
var approver_current = app.approver;
gs.eventQueue('approval_reminder_request'.,app, gs.getUserID(), approver_current);
gs.info("Number of Approval Records " + count);
}
}
Regards,
Shyamkumar
Regards,
Shyamkumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2024 10:44 PM
@shyamkumar VK ,
i have updated the script you mentioned and checked the event logs it's processed but the notification is not trigger i am attaching the notification screenshot please let me know.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2024 11:16 PM
Can you please show me the Whom to Send Config
Regards,
Shyamkumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2024 11:31 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2024 11:39 PM - edited 01-29-2024 11:40 PM
@Vani14 , enable Param2 as we are sending Approver in parm2
Regards,
Shyamkumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2024 09:54 PM - edited 01-29-2024 09:55 PM
@Vani14 ,
Seems you have Included Incorrect Event in the Script and also need some changes in script , have updated the Script , can you please try with this
var app = new GlideRecord('sysapproval_approver');
app.addQuery('state','requested');
app.addQuery('source_table', 'sc_request');
app.addQuery('sys_created_onRELATIVELE@dayofweek@ago@1'); // it should be created on not updated on
app.orderBy('approver');
app.query();
var count = app.getRowCount();
while(app.next()){
var approver_current = app.approver;
gs.eventQueue('approval_reminder_request'.,app, gs.getUserID(), approver_current);
gs.info("Number of Approval Records " + count);
}
}
Regards,
Shyamkumar
Regards,
Shyamkumar