Send Notification on Following Condition
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2024 09:44 PM
Hello Everyone,
While working on Email Notification I was stuck at following requirement i.e:-
1. When the RTIM Submitted
2. If the RITM is not approved after Five days.
3. If the RITM is not approved after Ten days.
4. The RTIM Cancelled if it is not approved, after 14 days.
Anyone who could complete my requirement it will be very helpful to me
Kind Regards,
Suyash Joshi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2024 10:46 PM - edited 01-10-2024 10:49 PM
Hi Suyash,
1. When the RTIM Submitted - Create normal Notification on sc_req_item table and add condition item is your catalog item name and send notification to your requested person.
2. If the RITM is not approved after Five days. - use scheduled job for below requirement
Glide to RITM table and take correct RITM sys ID and your item
var gr = new GlideRecord('sc_req_item');
gr.addQuery('item','your item sysID');
gr.query();
if(gr.next()){
// user below Approval script
}
use below script to validate if approval is created and not updated to approved for 5 days.
use script in workflow and check if Approval is approved or not.
var gr = new GlideRecord('sysapproval_approver');
gr.addEncodedQuery('sysapproval='+current.sys_id);
gr.addEncodedQuery('state!=approved^sys_created_onRELATIVEGT@dayofweek@ahead@5');
gr.query();
if(gr.next())
{
// send notification using eventQueue;
}
4. The RTIM Cancelled if it is not approved, after 14 days. And use Wait for condition in workflow.
if(current.state==''cancelled') // add your cancelled state value;
{
var gr = new GlideRecord('sysapproval_approver');
gr.addEncodedQuery('sysapproval='+current.sys_id);
gr.addEncodedQuery('state!=approved^sys_created_onRELATIVEGT@dayofweek@ahead@5');
gr.query();
if(gr.next())
{
// send notification using eventQueue;
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2024 11:09 PM
Can you give me a EXAMPLE of eventQueue I have no knowledge about notification.