I need to set the due date for the approvers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-06-2025 11:20 PM
Hi,
I need to set the due date for the approvers for one hour. The below script i have used.
Kindly help on this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-06-2025 11:35 PM
you want to add 1 hour to current date/time and set
if yes then do this
you can use addSeconds() function and give 3600 seconds = 1hour
var gdt = new GlideDateTime();
gdt.addSeconds(3600);
return gdt.getValue();
If my response helped please mark it correct and close the thread so that it benefits future readers.
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-06-2025 11:52 PM
The approvers are getting triggered for both the scripts. But the due date is empty in the approval record and flow is still waiting even after due date is passed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2025 12:42 AM
where are you using that script?
You didn't share the complete detail
What's your business requirement?
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-07-2025 12:48 AM - edited 01-07-2025 01:02 AM
I am using this script in the due date script field in the "ask for approval"