Start a conversation

How do I delete tickets in bulk? (download customers only)

We're actively rewriting our user guide, so check back for improved coverage.

If you try to delete a significant amount of tickets, empty trash with thousands of records or cleanup spam you suddenly got attacked with, your database will probably time-out. Instead, you can use the following solution: 

  1. Download the script attached to this article. 
  2. You will need to edit it, and fill in the server name, database name, username and password for your MySQL server.
  3. Backup your database. PLEASE MAKE SURE YOU HAVE A VALID, LATEST BACKUP OF YOUR DATABASE BEFORE USING THIS SOLUTION!
  4. Edit the script according to your needs and run it. 

You can edit the following line to match your needs (it currently removes tickets that were created before certain date):

$result = mysql_query("select ticketid from swtickets where date(from_unixtime(dateline)) < '2011-12-31'");

for example if you need to delete all tickets from one user:

$result = mysql_query("select ticketid from swtickets where userid='ID OF YOUR USER'");

If you need to remove all tickets from trash: 

$result = mysql_query("select ticketid from swtickets where departmentid=0");


cleantickets.php

  1. 4 KB
  2. View
  3. Download
Choose files or drag and drop files
Was this article helpful?
Yes
No
  1. Ana Vukina

  2. Posted
  3. Updated