- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-11-2017 01:51 AM
Hi Guys,
Can anyone help me on how to create an automatic notification to requested for of a Request Item if the tickets are still Waiting for Approval and Created more than 2 days. Many thanks for your help.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-11-2017 03:11 AM
Hi All,
Thank you ALL so much for your help. All replies are helpful. For record purposes, I will summarize and combine all suggested solution:
Step 1. I created a Template for the Notification.
Step 2. I created an Event.
Step 3. From this Template I created a Notification thanks to Kuruva Venkateswarlu and Amlan Pal.
Step 4. I created a Scheduled job (script from @Sneha Binani)
var gr = new GlideRecord("sc_req_item");
gr.addEncodedQuery("stage=waiting_for_approval^sys_created_onRELATIVELT@dayofweek@ahead@2^cat_item=da4e262f3784620065f498a543990ed4");
gr.query();
while(gr.next()){
gs.eventQueue("sap_user.requesters.reminders",gr,"","");
}
For Wednesday:
For Friday:
I was able to complete what I want. Again thank you all!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-11-2017 02:22 AM
Hi Amlan,
Thanks. I have followed your instructions and we have 39 tickets that are created more than 2 days but the notification won't work. Here's what I've done so far:
I created a Template which contains the email body and created the notification you said. Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-11-2017 02:25 AM
Hi Diane
For Every two days we need to create a Schedule job for this place this script in the Schedule job script
var tsk = new GlideRecord('sc_req_item');
tsk.addQuery('request_item',current.sys_id);
tsk.addQuery('active','true');
tsk.addQuery('stage','');//place ur stage value here
tsk.query();
while (tsk.next()){
gs.eventQueue("sc_req_item.state",current,gs.getUserName());
}
You need to configure the Email Notification on Requested Item (sc_req_item) table with the conditions and other configurations as of below screen shot
i hope this will helpful to u
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-11-2017 02:32 AM
Hi Diane,
You need to create a schedule job with the same condition as mentioned in when to send field here in Notification and then trigger the event from there.
Here are the steps.
1. Go to System Policy -- registry.
Create a registry by giving the name as trigger.notification.ritm and table as sc_req_item.
2. Create a Schedule Script exceution
Place the below code.
var gr = new GlideRecord("sc_req_item");
gr.addEncodedQuery("stage=waiting_for_approval^sys_created_onRELATIVELT@dayofweek@ahead@2");
gr.query();
while(gr.next()){
gs.eventQueue("trigger.notification.ritm",gr,"","");
}
3. Now in Notification select when to run as Event is triggered and select the same event that is created.
Place in your template and ither details.
Hope this helps you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-11-2017 02:48 AM
Hello Sneha,
Thank you for your response. How can I set the Scheduled Jobs to only execute every Wednesdays and Fridays? Many thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-11-2017 02:52 AM