Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

By using the Set field values in ATF servicenow i want to set the outage end time

kranthi2
Tera Expert

Hi,

By using the Set field values in ATF service now i want to set the outage end time.

 

By using the Set field values i have set the Outage start time as current date and time which is mentioned below step

 

 

kranthi2_0-1725954163115.png

 

kranthi2_1-1725954228074.png

I want to set the Outage end time next to 2 or  3 minutes of Outage start time which means 10-09-2024 07:34:53.

 

Please help me out do we have any modifications under the javascript:gs.daysAgo(0) any method need to be used for Outage end time dynamically.

 

Thanks

 

 

 

 

1 ACCEPTED SOLUTION

Please check the screenshot in my above reply.

 

You can use the below to add 3 minutes for the current date time

 

 

javascript: var gdt = new GlideDateTime();gdt.addSeconds(180);gdt;

 

 

amaradiswamy_0-1725965205755.png

 

View solution in original post

3 REPLIES 3

amaradiswamy
Kilo Sage

Hi @kranthi2 ,

 

You can use GlideDateTime(). I tried with below and it works for me to set Begin date as same as the running time and End as begin date + 900 seconds . You can set 120 or 180 seconds to set the end date to 2 0r 3 minutes after the current time respectively

 

amaradiswamy_0-1725958151093.png

 

Set begin -- javascript:new GlideDateTime();

 end -- javascript:var gdt = new GlideDateTime();gdt.addSeconds(180);gdt;

 

 

 

Hi @amaradiswamy 

Thanks for your response, please help me out for Outage End time which syntax i could place?

 

Thanks

Please check the screenshot in my above reply.

 

You can use the below to add 3 minutes for the current date time

 

 

javascript: var gdt = new GlideDateTime();gdt.addSeconds(180);gdt;

 

 

amaradiswamy_0-1725965205755.png