javascript:gs.minutesAgoStart on Scheduled Job script

nogizaka46_jame
Kilo Contributor

I was trying to use a scheduled job to create a change ticket, if I want to set the work start / work end field to a specific time, what's the equivalent of javascript:gs.minutesAgoStart when I translate It to a script using the scheduled job? The thing is the I've already used the javascript:gs.daysAgoStart and javascript:gs.daysAgoEnd for the date using the template within the scheduled job. Or Is It much better if I use a full script for the date/time field for workstart/workend field of the change ticket?

Regards,

8 REPLIES 8

Thanks James for the update. for the time field sample code. Adjust it accordingly.



var start = new GlideDateTime("2011-01-01 12:00:00");


var end = new GlideDateTime("2011-01-01 12:00:00");


gr.start_date = new GlideDateTime(start);


gr.end_date = new GlideDateTime(end);


Thank you Chirag!


Hi James,



You should share some screenshot to avoid confusion  



Currently template doesn't have date picker for Planned Start/End date fields in Helsinki & Geneva releases but the date picker available in Istanbul release.



**Helsinki & Geneva


Screen Shot 2017-06-05 at 3.48.46 AM.png



**Istanbul


Screen Shot 2017-06-05 at 3.49.08 AM.png


chirag_bagdai
ServiceNow Employee
ServiceNow Employee

Hi James,



If your query is resolved, would you mind marking answer as correct and close the thread.