Shift by CallBack Script
You have to call on different shifts but the rules are not so simple to set as we can imagine . With the callback script rules , you can set as many different rules as you want, applying 1 single script.
The rules
You have to call 2 times during the week before to callback on weekend and have 2,5 days between each attempt. It means if we call on Monday morning (shift 1) , the next call must occur on Wednesday pm (shift 6)
Morning (08:00-13:00) | Afternoon(13:00-19:00) | |
Monday | Shift 1 | Shift 2 |
Tuesday | Shift 3 | Shift 4 |
Wednesday | Shift 5 | Shift 6 |
Thursday | Shift 7 | Shift 8 |
Friday | Shift 9 | Shift 10 |
Saturday | Shift 11 | Shift 12 |
If we want to iterate:
Call | next call |
Shift 1 | Shift 6 |
Shift 2 | Shift 7 |
Shift 3 | Shift 8 |
Shift 4 | Shift 9 |
Shift 5 | Shift 10 |
Shift 6 | if 2 calls, Shift 11 else shift 1 |
Shift 7 | if 2 calls, Shift 12 else shift 2 |
Shift 8 | shift 1 |
Shift 9 | shift 2 |
Shift 10 | shift 3 |
Shift 11 | shift 4 |
Shift 12 | shift 5 |
Create shitfs
First set your shifts . Select the task , properties, Callback
Insert as many shifts as you need
Create script
And then create your script
Select the cases where you want a callback by shift
Dim arrCalltoshift 'cases
Select Case [CallHistory.LastCallResult]
Case 1, 2, 3, 5, 9, 8, 11, 14, 15, 6, 15, 12, 14, 22, 23, 24, 25, 26, 27, 28
arrCalltoshift = 1
case else
arrCalltoShift = 0
end select
Select the next shift
Create a variable 'weekshift' where
'weekshift'=0 when there is less than 2 calls during the week , else
'weekshift'=1 when there is 2 consecutive calls during the week
if arrCalltoshift = 1 then
Dim weekshift
Dim CallShiftValid(2) 'where (2) is the mmaximum consecutive attempts number during the week
If ([Contact.CallCount] > 1) and ([CallHistory.LastCallShift]< 11) Then
CallShiftValid(1) = [CallHistory.arrCallShift]([Contact.CallCount] - 1)
CallShiftValid(2) = [CallHistory.arrCallShift]([Contact.CallCount] - 2)
End if
if (CallShiftValid(1) <> "") and (CallShiftValid(2) <> "") then
weekshift=1
else
weekshift=0
End if
If weekshift <> 1 then 'less than 2 calls during the week
If ([CallHistory.LastCallShift]<6) then
[Result.CallBackShift] = [CallHistory.LastCallShift]+ 5
Else
[Result.CallBackShift] = ([CallHistory.LastCallShift]+ 5) - 10
End if
If ([CallHistory.LastCallShift] = 11) then
[Result.CallBackShift] = 4
End If
If ([CallHistory.LastCallShift] = 12) then
[Result.CallBackShift] = 5
End if
End if
if weekshift = 1 then
If ([CallHistory.LastCallShift] = 6) or ([CallHistory.LastCallShift] = 8) then
[Result.CallBackShift] = 11
End If
If ([CallHistory.LastCallShift] = 7) or ([CallHistory.LastCallShift] = 9)then
[Result.CallBackShift] = 12
End If
End if
End if
If you want to run this example ,we have enclosed a package (📥 All_KB_Callback_shift_byscript.tsk) that you can import on your platform .