Send idle reminder message every 2 minutes in Live Agent

dokhiem_nguyen
Tera Contributor

Hi everyone,

 

As you may know, in Live Agent, when a user becomes idle in 2 minutes, the system will send the reminder message in the chat for both users and agents to notify whether they want to continue the conversation. And after specified amount of time (ex: 1h) if user is still idle, the conversation will be automatically closed.

 

During the investigation, I found that there is a script include called IdleChatHandler which is triggered by Idle Chat Timer Task scheduled job.

 

My question is about regarding to OOTB behaviour, the reminder message is sent only once when user is idle in 2 minutes, so are there any way to modify the script that the reminder message can be sent every 2 mins if user is idle for a long time? (E.g: No user response in first 2mins --> reminder message is sent --> No user response in next 2 mins --> reminder message is sent again...)

 

dokhiem_nguyen_0-1689408707732.png

 

3 REPLIES 3

Tushar
Kilo Sage
Kilo Sage

Hi there,

 

Modify the IdleChatHandler script includes to send the reminder messages every 2 minutes if the user remains idle for a long time.

 

// Original code to send the reminder message

var reminderSent = false; // Add this line to track if the reminder has been sent already

if (/* Check if the user is idle */) {

  if (!reminderSent) {

    // Send the reminder message

    reminderSent = true;

  }

}

 

// New code to send recurring reminders every 2 minutes

var reminderInterval = 120; // Set the reminder interval in seconds (2 minutes = 120 seconds)

while (/* Check if the user is still idle and the conversation is active */) {

  if (/* Check if the user is idle and enough time has passed since the last reminder */) {

    // Send the reminder message

  }

  // Wait for the specified interval before checking again

  gs.sleep(reminderInterval * 1000); // Convert seconds to milliseconds

}

 

Thanks,

Tushar

Hi @Tushar  ,

CC: @Everyone 

 

Thank you for your solution. However, when I read the code, I don't think this code part you suggested can be applied in the script include. As I already said in the question, the IdleChatHandler script include is called from Idle Chat Timer Task scheduled job and this job is set to run every 2 mins by default.

If this code part is applied to script include, this will impact heavily to the performance of SNOW system. So 

do you have any other ideas for this idle reminder scenario?

 

Please refer via links:

Idle Chat Timer Task: https://<your instance name>/sysauto_script.do?sys_id=90e0b96e3b5000109cbbcea234efc42f&sysparm_record_target=sysauto&sysparm_record_row=1&sysparm_record_rows=1&sysparm_record_list=nameSTARTSWITHIdle%5EORDERBYname

 

IdleChatHandler: https://<your instance name>/sys_script_include.do?sys_id=8a1a896a3b1000109cbbcea234efc4cf&sysparm_record_target=sys_script_include&sysparm_record_row=1&sysparm_record_rows=4115&sysparm_record_list=ORDERBYDESCsys_updated_on

Hi there,

 

Apologies for the misunderstanding. If the IdleChatHandler script include is called from a scheduled job that runs every 2 minutes, modifying the script include as suggested would indeed impact performance and may not be suitable.

 

I think you will have to create a new script or business rule that runs at regular intervals (e.g., every 2 minutes).

In the script or business rule, query the chat conversations that are idle (based on your idle criteria, e.g., no user response for a specified period).

now for each idle chat conversation, send the reminder message to the user.

 

Mark as correct and helpful if it solved your query.

Regards,
Tushar