How to get time after 1 hour start time from start time
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-30-2022 01:53 AM
Hello All,
I'm trying to send notification to user's whose reservation is after 1 hour from start time.
Start (Date field) if the field value is after 1 hour from start then we need to send the notification, I'm trying the below code but couldn't able to script the required logic.
var reservationsGr = new GlideRecord('sn_wsd_rsv_reservation');
reservationsGr.addActiveQuery();
reservationsGr.addQuery("is_parent", false);
reservationsGr.addQuery("state", "confirmed");
reservationsGr.addQuery("start", ">=", start(gs.hoursAgo(-1)));
//reservationsGr.addQuery("start", "<=", gs.hoursAgo(-2));
reservationsGr.query();
while(reservationsGr.next()){
gs.print('number ' + reservationsGr.number);
}
Could you please help me with the script to get records after 1 hour start.
Thanks,

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-30-2022 01:59 AM
Hi there,
What's the reason for scripting this? Have you considered applying a No Code solution?
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020-2022 ServiceNow Community MVP
2020-2022 ServiceNow Developer MVP
---
LinkedIn
Community article, blog, video list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field