Conversation is not reopening on reopen click intercept event

I have a requirement like on conversation reopen need to reassign the agent who is previously assigned but for only to a specific group, it should not be reassigned. To perform this I’m using reopen click and trying to update the conversation with the previously assigned agent if the condition satisfies. It’s entering into the callback function but the conversation is not reopening.
Here is the code snippet that I used"conversation.onReopenClick", eventCallback, { intercept: true });
 var eventCallback = function (event) {
            console.log(event.type + " event occurred");
            console.log("in reopen click event....")
            getUserProp(client, function (userData) {
                var userprops =;
                for (var i = 0; i < userprops.length; i++) {
                    console.log(userprops[i].name, userprops[i].value);
                    if (userprops[i].name === 'Agent Id') {
                        reassignAgent(client, userprops[i].value);
       function reassignAgent(client, agentId) {
          getAssignedAgent(client, function (data) {
               if (data.groupId !== '68b1fb28-7233-439a-bb05-dbc3009cadf3') {
                var url = `${data.convId}`;
                 var headers = {
                      "Authorization": "Bearer <%= iparam.apiKey %>"
                 var body = JSON.stringify({
                "status": "assigned",
                "assigned_agent_id": agentId
            var options = {
                headers: headers,
                body: body
            client.request.put(url, options).then(function (updateData) {
                console.log("Agent assigned successfully...")
            }, function (error) {
        } else {
            console.log("do nothing..");

Please find out the below recording URL about the issue
conversation not getting reopened? Can you let me know why it is blocking to reopen?


Hi Soujanya,

Intercept events are paused until the event listener is executed.

As mentioned in the document Events Method

// To allow the original event to continue

// To prevent the original event from completing‘errorMessage’)

Kindly update the code snippet with event.helper.done() and revert back if the issue still persist.

Janani V.


Thanks, @Janani_V it worked fine now :slightly_smiling_face:


1 Like