Genesys Cloud - Main

 View Only

Discussion Thread View
Expand all | Collapse all

Clear emails in the queue.

  • 1.  Clear emails in the queue.

    Posted 12-23-2019 03:37

    Hello All

    I want to know if there is any way to clear the emails in the queue, i.e., there is a customer with multiple flows and multiple queues and each queue is handled by different agent.
    Now, these were set up long back and have been inactive for long time. Today if i add some one the queue, he is seeing all the emails in the queue which were waiting since may be 1000+ hours. i know this behavior is correct and normal.

    Is there any way i could clear the emails waiting in the queue. or what i have done is i created another queue and changed the email routing to this flow. In this case i cannot delete the old queue  with an error message - Error deleting the queue( i guess because there are so many emails waiting in this queue)  

    Is there any way to overcome this or any workaround solution to just clear the interactions in queue.

    Thanks in advance



    #emails #queue #Routing #purecloudemails #PureCloudACD #Contactcenteradministration

    ​​​​​​​​
    #ArchitectureandDesign
    #DigitalChannels
    #Implementation
    #PlatformAdministration
    #Roadmap/NewFeatures
    #Routing(ACD/IVR)

    ------------------------------
    Teja Darbha
    Jathwa Technology Solutions
    teja.darbha@jathwa.com
    Riyadh Saudi Arabia
    ------------------------------


  • 2.  RE: Clear emails in the queue.

    Posted 12-23-2019 15:40
    I looked through the interface and API and came up with nothing.  The only possibility is to use the queue observation in the Analytics API to get a listing of all the conversations and then use PostMan to individually or in bulk 100 at a time.  


    ------------------------------
    Robert Wakefield-Carl
    Avtex Solutions, LLC
    Contact Center Innovation Architect
    robertwc@avtex.com
    https://www.Avtex.com
    https://RobertWC.Blogspot.com
    ------------------------------



  • 3.  RE: Clear emails in the queue.

    Posted 12-25-2019 00:48
    Edited by Paulo Mesquita do not use 12-25-2019 00:50
    I am not sure if the PureCloud support can help with this.

    Maybe they have an app or a script like this one to disconnect email interactions:

    https://developer.mypurecloud.com/blog/2018-02-07-disconnecting-queued-interactions/

    ------------------------------
    Paulo Mesquita
    Spark NZ Trading
    ------------------------------



  • 4.  RE: Clear emails in the queue.

    Posted 12-25-2019 08:29
    Thank you for the suggestions. I'll look in to them.

    ------------------------------
    Teja Darbha
    Jathwa Technology Solution
    teja.darbha@jathwa.com
    Riyadh Saudi Arabia
    ------------------------------



  • 5.  RE: Clear emails in the queue.

    GENESYS
    Posted 12-26-2019 10:49
    I doubt Care/Support can help with it. I was going to suggest you take a look at the thread on the Developer forum as well. That was something a former internal employee created, but using GO. I started to create my own version of the script in Node.js, but never got around to much. Nothing useful..

    ------------------------------
    George Ganahl GCP (PureCloud) ICCE
    Principal Technology Consultant
    Genesys
    ------------------------------



  • 6.  RE: Clear emails in the queue.
    Best Answer

    GENESYS
    Posted 12-27-2019 11:24
    Edited by Teja Darbha 12-29-2019 02:44
    Teja,

    This is not anything "official" but I have written a script that will run in the Code Edit of PureCloud's Developer Tools (https://developer.mypurecloud.com/developer-tools/#/codeeditor)  that will "disconnect" (a.k.a. delete) conversations in a queue.  You can get the code from my personal GitHub repository here: https://github.com/crespino4/PureCloudScripts/blob/master/DeleteQueuedInteractions.js

    There are a few caveats to using it and your mileage may vary:

    1. At the top of the script are two variables, 'queueName' and 'dateRange' which are really the only two things in the code you will have to change.  You should change the values between the quotes to match your need.  The currently checked in script deletes from a queue named 'AppFoundry' and a date range between December 1 2019 and January 1 2020.
    2. It performs an analytics query to get a batch of 100 queued conversations at a time, so if you have more than a 100 you will have to manually press the 'run' button to run the script until there are no more conversations for that date range.
    3. This deletes ALL conversations in a given queue.  The analytics query could be modified to delete certain media types, etc.  You can use the Analytics Query Builder in the Developer Tools to generate a new query body for your needs.
    4. There isn't much in the way of error handling as I just use this for quick and dirty clean-up of interactions that I generate when testing use cases.

    Here is a screenshot of what it looks like in the Developer Tools (click on the image to see it in a better resolution):


    Good luck.


    ------------------------------
    Jim Crespino
    Senior Director, Developer Evangelism
    Genesys
    https://developer.genesys.com
    ------------------------------



  • 7.  RE: Clear emails in the queue.

    Posted 12-29-2019 04:00
    Hi Jim 

    Good day! 

    The solution was working great.

    Initially i faced a error but i have no idea why, kindly find the below image 

    Later when i tried it with different email queues it was working fine.



    Thanks for the solution.


    Regards

    ------------------------------
    Teja Darbha
    Jathwa Technology Solution
    teja.darbha@jathwa.com
    Riyadh Saudi Arabia
    ------------------------------



  • 8.  RE: Clear emails in the queue.

    GENESYS
    Posted 12-30-2019 10:35
    Glad to hear that is worked on the "email_queue".  I will say that the queueName variable is case sensitive, so it has to match the exact spelling and case of the queue name that you see in PureCloud Admin.

    ------------------------------
    Jim Crespino
    Senior Director, Developer Evangelism
    Genesys
    https://developer.genesys.com
    ------------------------------



  • 9.  RE: Clear emails in the queue.

    GENESYS
    Posted 12-30-2019 10:43
    I received the same error initially. I think maybe due to a brief PureCloud outage that required me to log out, refresh the browser, and log back in to make sure I was logged in properly. Then it worked fine with the same settings that initially produced the error.

    ------------------------------
    George Ganahl GCP (PureCloud) ICCE
    Principal Technology Consultant
    Genesys
    ------------------------------



  • 10.  RE: Clear emails in the queue.

    Posted 12-31-2019 02:28
    Hello Jim,

    Thank you i guess it was due to case sensitiveness. and when i tried with other queues it was fine.

    Hello @George Ganahl,

    Yes, in my case the issue was solved after reloading the page.

    Once again thanks for your valuable time.

    Wish you a Happy New Year.

    Regards


    ​​

    ------------------------------
    Teja Darbha
    Jathwa Technology Solution
    teja.darbha@jathwa.com
    Riyadh Saudi Arabia
    ------------------------------



  • 11.  RE: Clear emails in the queue.

    Posted 06-03-2020 15:57
    is it possible to create a variable for email?
    It would be for example "null" (for everyone) or a specific email for delete

    ------------------------------
    Kaio Oliveira
    InvenIT Prestacoes de Servicos LTDA
    ------------------------------



  • 12.  RE: Clear emails in the queue.

    Posted 07-26-2020 18:31
    Hi Jim,

    Is there anyway we can mass delete email contacts on a queue (just like this one) but only for a specific email address? Say a Spam email  already in the queue that need to be removed from it?

    ------------------------------
    Jay Sorrosa
    TechStyle Fashion Group (f/k/a Just Fabulous, Inc.)
    ------------------------------



  • 13.  RE: Clear emails in the queue.

    Posted 07-27-2020 06:40
    Jay,
    I ran into a use case like this a few months back (25K+ invalid email notifications from the same sender...) so I thought I'd share what we did in case it helps.

    We used this API call to perform a bulk delete. The segmentFilters used were addressFrom = sender email address and mediaType = "email". (I'll note that the queue they were routed to was not considered, so if that matters this may or may not be a viable solution.)

     https://developer.mypurecloud.com/forum/t/remove-emails-from-queue/2037



    ------------------------------
    Emily Kammerer
    Ascendium Education Group, Inc.
    ------------------------------



  • 14.  RE: Clear emails in the queue.

    Posted 09-01-2022 11:02
    Hi Jim,

    Is there any way to also search on an email address or subject line only and just delete/disconnect those?  We have thousands of spam emails in one of our queues that we would like to purge.

    ------------------------------
    Chris Peters
    Cox Automotive Corporate Services, LLC
    ------------------------------



  • 15.  RE: Clear emails in the queue.

    GENESYS
    Posted 09-01-2022 11:51
    Chris,

    The Analytics Query Builder tool that is part of our Developer Tools and runs live against your Genesys Cloud is a great tool to play around with queries to see what you can select.  There are numerous Segment Filters that you can query against and 'addressFrom' and 'subject' are both items you can query on.  The filters use "and" and "or" expressions so that you can search for either, or, or both fields.  Here is what a segmentFilter might look like that search for a specific email address "or" subject.

     "segmentFilters": [
      {
       "type": "or",
       "predicates": [
        {
         "type": "dimension",
         "dimension": "addressFrom",
         "operator": "matches",
         "value": "jim.crespino@genesys.com"
        },
        {
         "type": "dimension",
         "dimension": "subject",
         "operator": "matches",
         "value": "This is a test email subject"
        }
       ]
      }
     ]
    Note, you can combine those segment filters with the queue filters and any other filters that you want to build the appropriate query.

    ------------------------------
    Jim Crespino
    Senior Director, Developer Evangelism
    Genesys
    https://developer.genesys.com
    ------------------------------



  • 16.  RE: Clear emails in the queue.

    GENESYS
    Posted 09-01-2022 11:57
    Chris,

    One other thing to note, if you were interested in purchasing a product that can help you manage emails on an ongoing basis you could look at the following AppFoundry marketplace products:

    Advanced eMail Interface - AMI: https://appfoundry.genesys.com/filter/genesyscloud/listing/7f9c446e-0ec8-4aac-ae14-1f2ebe8f09f3
    Email Ninja: https://appfoundry.genesys.com/filter/genesyscloud/listing/8e458a3b-bac0-4280-8964-661a3b00b118

    Both of those should help you search for emails in queues and perform bulk deletes.

    I hope that helps.

    ------------------------------
    Jim Crespino
    Senior Director, Developer Evangelism
    Genesys
    https://developer.genesys.com
    ------------------------------



  • 17.  RE: Clear emails in the queue.

    Posted 09-02-2022 12:21
    Hey Jim,

    We have Email Ninja, but it locks up when we try to perform large bulk deletes. 

    We just had to change the colon to a semicolon on the first line of your code and it worked. 
    "segmentFilters"; [
    Queue is now spam free and coincidentally had another queue this morning that needed some cleaning as well.  This is a great tool and with more of our groups adding email this will come in handy.

    Thanks Jim!

    ------------------------------
    Chris Peters
    Cox Automotive Corporate Services, LLC
    ------------------------------



  • 18.  RE: Clear emails in the queue.

    Posted 11-07-2023 18:15

    And this for more advanced use-cases: https://appfoundry.genesys.com/filter/genesyscloud/listing/59c44a27-fb86-4806-8640-18a99c7f544f

    You can cancel emails in a Queue pretty easily:



    ------------------------------
    Maksim Gill
    Eccentex (Advanced Case and Email Management Platform for Genesys)
    https://www.eccentex.com/genesys
    ------------------------------



  • 19.  RE: Clear emails in the queue.

    Posted 11-06-2023 00:58

    With the Code Editor now gone, what's the alternative to running a script like this to clear a bunch of interactions from a queue?

    Thanks



    ------------------------------
    Robert Niblock
    APM
    ------------------------------



  • 20.  RE: Clear emails in the queue.

    GENESYS
    Posted 11-06-2023 14:45

    Robert,

    The code editor was a fortunate tool to take advantage of but it was never meant to be a longer term means to execute code on a daily basis.  In this particular instance there are a couple of options:

    1. The code for this example can easily be adapted to run with Node.js.  
    2. If you have an IT admin who is good at the command line, then the Genesys Cloud Command Line Interface (CLI) could be used for this.
    3. Lastly, there are now in-queue email flows, so you can probably use an in-queue email flow to look at emails that are old/unanswered and use a Data Action to call the Conversations API to "disconnect" those emails.  This might actually be the most foolproof and automatic way to handle things so that someone doesn't have to manually clean things up.

    I hope that helps.



    ------------------------------
    Jim Crespino
    Senior Director, Developer Evangelism
    Genesys
    https://developer.genesys.com
    ------------------------------



  • 21.  RE: Clear emails in the queue.

    Posted 11-06-2023 15:12

    Why not build a quick bot that could ask for the queue and date range and then runs the API to delete them?  



    ------------------------------
    Robert Wakefield-Carl
    ttec Digital
    Sr. Director - Innovation Architects
    Robert.WC@ttecdigital.com
    https://www.ttecDigital.com
    https://RobertWC.Blogspot.com
    ------------------------------



  • 22.  RE: Clear emails in the queue.

    GENESYS
    Posted 11-06-2023 17:34

    Now that would be cool, a Genesys Operations Bot!  You could have it perform all kinds of operations!



    ------------------------------
    Jim Crespino
    Senior Director, Developer Evangelism
    Genesys
    https://developer.genesys.com
    ------------------------------



Need Help finding something?

Check out the Genesys Knowledge Network - your all-in-one access point for Genesys resources