Shift by Callback Script
With the callback script rules in Askia, you can set as many different rules as you want, from a single script.
The rules are perhaps best explained by using an example scenario. In this scenario let's say you have to attempt calls to your numbers twice during the week, before calling back at the weekend and have 2.5 days between each attempt. It means if you call on Monday morning (shift 1), the next call must occur on Wednesday afternoon (shift 6).
|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 you want to iterate:
|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|
Firstly you will need to set your shifts. Select the task , properties, Callback . . .
Insert as many shifts as you need . . .
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
arrCalltoShift = 0
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 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)
if (CallShiftValid(1) <> "") and (CallShiftValid(2) <> "") then
If weekshift <> 1 then 'less than 2 calls during the week
If ([CallHistory.LastCallShift]<6) then
[Result.CallBackShift] = [CallHistory.LastCallShift]+ 5
[Result.CallBackShift] = ([CallHistory.LastCallShift]+ 5) - 10
If ([CallHistory.LastCallShift] = 11) then
[Result.CallBackShift] = 4
If ([CallHistory.LastCallShift] = 12) then
[Result.CallBackShift] = 5
if weekshift = 1 then
If ([CallHistory.LastCallShift] = 6) or ([CallHistory.LastCallShift] = 8) then
[Result.CallBackShift] = 11
If ([CallHistory.LastCallShift] = 7) or ([CallHistory.LastCallShift] = 9)then
[Result.CallBackShift] = 12
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 .