Using a Custom Script to Calculate "Minus 2 Business Days"
Hi All,
My organization has recently moved to using ServiceDesk Plus/ManageEngine to manage our various helpdesk tickets. One team uses a form with an additional Date/Time field called Depart Date (UDF_DATE_2) that we would like to use to update the Due By time of the request. I've been informed that this is not possible on form submission, but it is possible when the form is edited or on the field change. The code below is how I have calculated the Due Date to be equal to this UDF_DATE_2 minus 48 hours and it works, but it would be more helpful to have a script that calculates "minus 2 business days" instead.
I've tried using functions like subBusinessDay(), but this did not seem to be accessible on our instance and the script failed. So instead I was hoping to get some ideas for how to code something like: due_by_time = UDF_DATE_2 - (2 business days). Any thoughts are welcome and appreciated!
var udf = "udf_date2";
var date = await CS.getValue("udf_fields." +udf);
CS.setValue("due_by_time",date.value- (48*3600*1000));
CS.end();
Best wishes,
Braden
New to ADSelfService Plus?