- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2019 01:19 PM
I am building an Automated test and having issues with a date/time field that is required. I need to fill it with a date/time that is always in the future of whenever I am running the test. I have seen several posts for this but none of the suggestions have worked for me. I am fairly new to ServiceNow so it definitely could be me. Any help is appreciated.
Thanks,
Tara
Solved! Go to Solution.
- Labels:
-
Automated Test Framework

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2019 07:12 AM
Hi Tara,
The easiest way I've found to do this is to use something like gs.daysAgo() or gs.hoursAgo() in the date/time field like this:
Using a negative number sets a date in the future, so this would set resolved to two weeks from when the test is run.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2019 07:12 AM
Hi Tara,
The easiest way I've found to do this is to use something like gs.daysAgo() or gs.hoursAgo() in the date/time field like this:
Using a negative number sets a date in the future, so this would set resolved to two weeks from when the test is run.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2022 06:02 AM
Hi Brad ,
Is there a function which set 10 minutes or 20 minutes in future from the current time .

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2022 06:19 AM
Something like gs.minutesAgo(-10) should work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2022 03:26 AM
Thanx a lot .It worked .