PrashantLearnIT
Giga Sage

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.

Comments
Shruti Navalgu2
Tera Contributor

Could you please mention the script for excluding weekends and adding 7 days.

Version history
Last update:
‎08-05-2022 07:40 AM
Updated by: