You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
P2 - add 4hrs to the Created date but if it's exceed the working hrs of of 5 PM the add to the next day or if the is before the working hours of 8 AM set 5 PM to the same Created date.
14
+
P3 or P4 - Kind of low priority so add the due date to the next day but it should exclude the holidays and the weekend's and the populate the next business working day.
15
+
16
+
*/
17
+
18
+
19
+
// This SI findDueDate() function will help to calculate the duration based on the each priority.
20
+
21
+
varCalculateDueDates=Class.create();
22
+
CalculateDueDates.prototype={
23
+
initialize: function(){},
24
+
25
+
findDueDate: function(priority,created){
26
+
vardueDateVal;
27
+
28
+
29
+
// For the Priority 1 and adding 4 hours in reagrd less of 8-5 working hours and then holidays
30
+
if(priority==1){
31
+
varnow=newGlideDateTime(created);
32
+
now.addSeconds(60*60*4);// Add 4 hours
33
+
dueDateVal=now;
34
+
returndueDateVal;
35
+
36
+
}
37
+
38
+
// For the Priority 2 and adding the 4 hours if exceed the workin hours then add the next day before 5'o Clock
Will not appeare if the value is already there and the priority is 5
13
+
14
+
Output
15
+
1. Due Date
16
+
17
+
*/
18
+
19
+
20
+
// The function duedate is used to pass the priority and then created display value to the script include where the calculate of Due date is done will get the response and the set the value to the due_date field of incident.
0 commit comments