How should I set to enter "Planned start date + 2hours" in the Change Task(change_task)'s DueDate?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-26-2023 07:41 PM
What settings will make the Change Task (change_task)'s DueDate auto-fill?
I want to set to enter "Planned start date + 2hours" in the Change Task(change_task)'s DueDate.
How should I set?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-26-2023 07:49 PM
Hi,
Please check below:
https://www.youtube.com/watch?v=t9MISYRfu8o
https://www.servicenow.com/community/developer-forum/adding-date-to-current-date/m-p/1674246
Thanks
Anil Lande
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-26-2023 09:36 PM - edited 12-26-2023 09:38 PM
Hi,
You can write a BR onBefore insert.
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var psd=new GlideDateTime(current.planned_start_date);
psd.add(3600000);
current.due_date=psd;
})(current, previous);
Thanks and Regards,
Saurabh Gupta
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-26-2023 11:12 PM
Hi @Saurabh Gupta
Thank you for your comment.
What does "3600000" mean?
Thanks anf Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-26-2023 11:18 PM
Hi Ayano,
This is the time unit we are giving as 3600000ms. It means 60min*60sec*1000. for 2 hrs you can use 7200000.
Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Pankaj Kumar