The CreatorCon Call for Content is officially open! Get started here.

Set current date as dynamic field value

Community Alums
Not applicable

I'm trying to use ATF to test the Change process, and when closing off the implementation phase I would like to use the current date set programatically, rather than having to set this manually before running the test. I don't seem to see any options for setting dynamic date/time values when setting up test steps, does anyone know if this is possible?

8 REPLIES 8

As I mentioned in my first response, for the Date field we need to use below

javascript: gs.nowDateTime().getDate();

without calling getDate() it will return Date and Time which will cause a problem here.

 

Regards,
Muhammad

If you will see my reply I have mentioned clearly which test step he has to use in order to do that

Ankur Bawiskar
Tera Patron
Tera Patron

@Adam Domanski 

you should set the local date as below in the ATF test steo

javascript: new GlideDateTime().getLocalDate();

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader