ATF Test step config: Cannot read properties of undefined (reading 'message') Dynamic Date/Time
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-21-2024 06:31 AM
I have made a config test step that should create a Dynamic Date/Time Value and Output it. The Value was created at some point (Calculated time 2024-10-21 15:22:07) but i cant use the value in the following step (Cannot read properties of undefined (reading 'message')). How do i fix this Issue?
Any help would mean a lot thank you.
var gdt = new GlideDateTime();
gdt.add(7500000);
//gdt.toString();
outputs.u_calculatedtime = eval('gdt');
//outputs.u_calculatedtime = 'gdt';
////outputs.u_calculatedtime = gdt;
stepResult.setOutputMessage('Calculated time ' + outputs.u_calculatedtime);
stepResult.setSuccess();
return outputs.u_calculatedtime;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2025 07:15 AM
Hi @phillipross.,
There is a very simple way to set the Date Dynamically.
Just use the script javascript:gs.daysAgo(X) in place of value, as shown in the below screenshot (sets Today's date).
Replace the X in brackets with any Number.
For Past Days: 1, 2, 3......
For Today: 0
For Future Days: -1, -2, -3......