I am researching a way to implement a mitigation for instances where users have emails assigned to them, but are not responding to them in a certain period of time. We have had instances in the past where users will field emails that are more critical than they appear, and then go offline or to lunch, for example, before responding.
As a part of my testing, I have already built actions against /api/v2/conversations/emails/{conversationId}/participants/{participantId}/replace
That, combined with a conversation Id lookup and gathering of participants, will allow me to forcibly remove the email from the agent and return it to queue. This works manually, I have tested this using an email with the conversation Id in the subject line as the trigger.
What I'm looking for now is a way to potentially automate this. I have looked at the process automation triggers and don't see one that quite fits what I am looking for:
queries for emails that are of a specific duration and unanswered (filterable in the trigger OR in a workflow would be fine)
also provides the conversationId
I also don't see a good way to be able to pull in conversations just based on a participant.
Does anyone know of a way to get this started? My alternative idea is to begin work on a widget application that would allow supervisors to paste in interaction Ids to easily return to queue, but would greatly prefer to automate this if possible.
I do sure wish this was built-in function, as the API exists and manual assignment works for other scenarios.
Got back to looking at this with a fresh set of eyes - I may be able to use v2.detail.events.conversation.{id}.user.start for this, and set my workflow to wait for the specified amount of time before checking the conversation stats.
Using v2.detail.events.conversation.{id}.user.start to trigger a workflow, I am using a data table to filter the applicable queues. Then, I set a wait based on that queue for the workflow.
The workflow then uses the conversationId to pull GET /api/v2/conversations/emails/{conversationId} and return participantId values. Using this API, if the match is not an email, you still get a return, but the participants array is empty.
I'm then doing a count against my participantId array. If it's 0, we abort the workflow (it's not an email). If there is a count, we set a new variable to that count. This functions to set a loop for the main purpose.
The loop uses the replace API to return the conversation to queue. This looks into the array for participantIds and tries them, each loop incrementing my integer variable for the GetAt I am using for this by 1, until we find a match or all participants are exhausted. If the email is already disconnected, there's no active participant, so it will go through and confirm. If there is an active participant, then it will find it in this loop and remove the email from the user.
Hope this helps anyone that needs a similar function.