This repository was archived by the owner on May 2, 2023. It is now read-only.

Description
I tried to implement the listed code for closing the conversation dialog and trigger the PCS bot, but was not working: conversation looks closed from consumer side, Survey in progress without any survey triggered was shown from Agent side.
Looking at the way to do the same action through Connector API (the 'unofficial' way), sounds like the closedCause parameter is missing.
By adding it, using the value 'AGENT', the PCS bot trigger works fine.
Here below the updated code to add in the readme file:
agent.updateConversationField({
conversationId: conversationId/dialogId,
conversationField: [{
field: 'DialogChange',
type: 'UPDATE',
dialog: {
dialogId: conversationId/dialogId,
state: 'CLOSE',
closedCause: 'AGENT'
}
}]
}, (e, resp) => {
if (e) { console.error(e) }
console.log(resp)
});