- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 08-05-2022 07:40 AM
I have explained how we can add 7 days in the Due Date field/Custom field using Business Rules in ServiceNow.
If you have any feedback related to the scripting part, please write it in the comment box.
====================BUSINESS RULES======================
Table - Requested Item
When to Run - Before and on Insert
Scripts -
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
var gd = new GlideDate();
gd.addDays(7);
current.u_estimated_time_of_delivery = gd;
var gdt = new GlideDateTime();
gdt.addDays(7);
current.due_date = gdt;
})(current, previous);
Best Regards,
Prashant
If my article helped you in any way, please mark this as helpful and make this a bookmark.
- 7,143 Views
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Could you please mention the script for excluding weekends and adding 7 days.