Deleting tickets

Return to top
Have more questions? Submit a request

44 Comments

  • Brett Bowser
    Zendesk Community Team

    Hi Melanie,

    You should be able to prevent your agents from viewing deleted tickets as mentioned in the following article: Enabling agents to delete tickets

    You can find this option under Admin>Settings>Tickets.

    Hope this helps!

    0
  • Hedda Klintskog

    Hey!

    By using the API, is there anyway I can see when a soft deleted ticket were solved? By doing a search in the API, I can e.g. get all the tickets that were solved before today by adding "query: type:ticket solved<2019-07-26". The response of this doesn't include deleted ticket that were solved before today. Is there anyway I can find deleted ticket with the API  according to when they were solved?

     

    Thanks.

    0
  • Bryan - Community Manager
    Zendesk Developer Support

    Hi Hedda. While not as flexible as Search, you can use the GET /api/v2/deleted_tickets.json endpoint to list deleted tickets. You can sort_by "deleted_at" and choose a "sort_order" of "desc" to get the most recent first.

    An alternative would be to monitor ticket update activity via one of the ticket incremental export APIs, but I'm guessing that is probably more than you would want to monitor and keep track of just for this use case. It sounds like using the deleted_tickets endpoint would be best.

    0
  • Hedda Klintskog

    Thank for your answer!

    I have another question, I'm trying to bulk delete old tickets with the API and I have to many tickets to it with just one request. Therefore, I'm using a loop until all the tickets I want to delete are deleted. The problem is that the API seems to be too slow, because the same ticket can be deleted multiple times. Can this be because the API dosen't have to register the ticket as deleted before I try to delete it again? Do anyone know how long time the ticket needs the register a deleted ticket?

     

    Best regards

    0
  • Bryan - Community Manager
    Zendesk Developer Support

    Hi Hedda -- can you confirm that you're using the DELETE /api/v2/tickets/destroy_many.json?ids={ids} API? It allows more than one ticket to be deleted at a time.

    I'm not sure what's meant by the "because the same ticket can be deleted multiple times" comment -- can you clarify this, too? If you have a simplified script or pseudo code, feel free to share and we can talk about that. Thanks!

    0
  • Hedda Klintskog

    Hi Bryan, and sorry for the really late response. I must of forgotten to answer you and I haven't been working with ticket deletion again until now. I still have the same problem: when i try to do multiple search requests followed by delete requests, the tickets dosen't respond the way I expect them to. In my code, I'm first finding the right tickets with a search request, saving the ids of these tickets and then deleting them with a destroy_many request.

    For example, if I try to delete 5000 tickets, the first search request respond with a list of 1000 tickets that I can delete. But the following search requests often only responds with 600-800 tickets. I tried with delays, and that helped a bit. I'm therefore wondering how long delay i should use? And is there any other way to solve this problem? I'm guessing the problem is that the API dons't have enough time to update the lists of tickets after the deletion. 


    My attempt to write pseudo code:

    while theres still tickets to delete:

      url = 'https:/domain.zendesk.com/api/v2/search.json?' + urlencode(params)
      response = session.get(url)
      list_of_all_tickets.append(result_from_search_request)
      time.sleep(x) #I'm looking for the right x to put here! I'm using 120 seconds right now
     
    This is probably a messy explanation, my question is really if I need to use delays when I'm bulk deleting tickets multiple times.
    0
  • Bryan - Community Manager
    Zendesk Developer Support

    Hello Hedda Klintskog -- no problem on the delay ;-)

    There are a couple of things that are impacting your solution. The first that you found out is that the Search API now limits its result set to 1000. Details are here for that: New Search API Result Limits 

    The second is that search's reindex process can take several minutes -- it's usually fairly quick, but there's no guarantees. That is mentioned here:

    "Note: It can take up to a few minutes for new tickets, users, and other resources to be indexed for search. If new resources don't appear in your search results, wait a few minutes and try again."

    Regarding your solution, it sounds like extending the delay may find the records you're looking for. There's also a community comment here that talks about segmenting search results by time (sort of a pseudo paging approach) that might be interesting to consider.

    You may also want to look in the Apps marketplace for existing "delete tickets" solutions that might meet your needs.

    Hope this helps!

    0
  • Sebastiaan Wijchers
    Community Moderator

    The article states:

    Explore: Deleted tickets are excluded from Explore reports by default. If you want to report about deleted tickets, use a query from the Ticket updates dataset using the Activity > Deletions dataset.

    This seems to be incorrect. When a ticket is soft deleted, it's removed from the 'Ticket updates' dataset as well. Only when you restore the (soft) deleted ticket, it will show up again and you can report about it's deletion. 

    0
  • Krista Shaver

    Does deleting a ticket without responding, count against your first time reply?

    0
  • Brett Bowser
    Zendesk Community Team

    Hey Krista,

    That depends on what you're using to report on First Reply Time. Explore/Insights have available metrics that will filter out Deleted tickets. If you're using the native reporting in the Support interface, this will include deleted tickets in your account.

    Let me know if that doesn't make sense :)

    Cheers!

    0
  • Mia Jonson

    Hi!

    Why does our end users see the tickets we have permanent deleted?

    This is a big problem because we have a lot of test tickets that we want to get rid of before we go live next week.

    How can we delete them from all views in the system?

    // Mia

    0
  • Nicole S.
    Zendesk Community Team

    Hi Mia - 

    When you permanently delete a ticket, it should remove it everywhere. If an end-user is still seeing it, they're likely looking at a cached page. The next time they refresh they should no longer be able to see those tickets. 

    0
  • Julian Lasser

    Hi everyone,

    This is more of a strategic question than a technical one: What's better when dealing with spam-created tickets? to delete them or to solve/close them immediately (like with a trigger/some automatic way) and tag them so they can be filtered out later in reports?

    Your reporting should be more accurate b/c these tickets are moved to the deleted ticket dataset and should not affect numbers in Explore. You also avoid adding filters to remove them from your final report.

    I'm inclined to delete them but wanted to be sure there's no side effect or other consideration to take into account before taking that route.

    Thanks,

    Julian

    0
  • Karen Stephen

    Julian Lasser, we had a large spam issue last year.  We found that deleting them was not an option (I don't have a dev to be able to take advantage of the API) so we wrote automations to deal with the 50K tickets that were the already and then triggers to deal with the new ones.  

    One of the advantages of this, is you can see when you have spam attacks and you can see the severity of them.  (We had 4 different waves hitting us.) If you don't care about the metrics of the spam, then deleting them keeps them out of your data and will make your searches, etc. cleaner.

    0

Please sign in to leave a comment.

Powered by Zendesk