In workflow approval will auto reject in 4 business days
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2023 11:14 PM
Hello,
We have a requirement that is in the catalog item workflow the approval will auto reject with in 4 business days.
can anyone suggest the script in the workflow.
Thanks in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2023 11:22 PM - edited 10-30-2023 11:23 PM
Hello @Servicenow de11,
For the scenario mentioned you can leverage Flow designer for this without scripting
1) Trigger - Record created on sysapproval_approver
2) then use Wait for a duration of time - give Wait for 96 hours; schedule as 24x7
3) the use If flow action and check if record is not approved
a) if yes then reject it
4) use update record action and set state as Rejected
Or you can even create a scheduled job that checks all open Approvals from x days ago and set them to rejected.
Hope that helps, Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2023 11:28 PM
Hello Shruti,
We are not using flow designer. we are only using workflows. Need workflow user approval activity script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2023 11:43 PM
workflow cannot do this thing.
you need a flow which runs daily or a scheduled job which runs daily and checks if 4 business days have elapsed for that approval record (based on created on date)
if yes and if it's requested state then reject it via script or flow action
what did you start with and where are you stuck?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader