- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2022 11:27 PM
Hi All,
I have following requirement to send the remainder notification.
Scenario: Service Requests which have Approval workflow defined needs to be approved within 2 weeks (14 Calendar days) of creation. If the request is not approved within 2 Weeks the request will get auto rejected and the requested for has to be notified accordingly. The week ends should be excluded when we send the Remainder notification on 0th day ,5th Day.10th Day and 14th Day .Please do let me know how to achieve this in workflow as soon as possible.
Notifications needs to be triggered as mentioned in the table below.
Day |
Trigger |
Users to be notified |
Request Stage |
Task State |
Day 0 |
Notification 1 |
Approver |
Waiting for approval |
Requested |
Day 5 |
Notification 2 |
Approver |
Waiting for approval |
Requested |
Day 10 |
Notification 3 |
Approver |
Waiting for approval |
Requested |
Day14 |
Notification 4 |
Approver & Requested for |
Closed Incomplete |
Cancelled |
Solved! Go to Solution.
- Labels:
-
Request Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2022 12:13 AM
you can run daily scheduled job and check the difference between created and now time and based on that send email
I have shared solution something similar earlier; enhance as per your requirement
sendEmail();
function sendEmail(){
try{
var gr = new GlideRecord('sysapproval_approver');
// add extra query if required
gr.addQuery('state=requested');
gr.query();
while(gr.next()){
var gdt = new GlideDateTime(gr.sys_created_on);
var nowTime = new GlideDateTime();
var duration = GlideDateTime.subtract(gdt, nowTime);
var days = duration.getDayPart();
if(days == 0 || days == 5 || days == 10 || days == 14){
gs.eventQueue("event_name", gr, 'your recipients');
}
}
}
catch(ex){
gs.info('Exception'+ex);
}
}
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2022 11:41 PM
Hi
regardless of the implementation approach (Scheduled Job, Flow, Workflow) you always can configure a business calendar (see https://docs.servicenow.com/bundle/rome-platform-administration/page/administer/time/concept/busines...)
OOTB there is already a Business Calendar for working days and excluding the weekends available you can choose.
An example for Scheduled Jobs:
Kind regards
Maik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2022 12:08 AM
Hi Maik,
Thanks for your reply.I want to know how can i send remainder notification for 5th day and 10th day and 14th day specifically?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2022 12:32 AM
Hi
okay, I suppose you are more a beginner and therefore I recommend using the Flow Designer which allows to implement your requirement with a no-code approach. Please have a look at the following resources for the Flow Designer approach:
- https://www.youtube.com/watch?v=hVctTUMWIcs
- https://community.servicenow.com/community?id=community_blog&sys_id=1fe969a71b9c1010fff162c4bd4bcb45
But in case you prefer the pro-code approach you will find the instructions at https://davidmac.pro/posts/2021-02-10-approval-reminder/
Let me know if you have any further questions.
Kind regards
Maik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2022 08:20 PM
Hi
In case you think I was able to answer your question, I would be happy if you mark the appropriate response as "correct" so that the question will appear as resolved for other users who may have a similar question in the future.
If not, please tell me what you are still missing!
Many thanks & kind regards
Maik