How to clear old Tickets in Connectwise Automate

DELETE FROM tickets WHERE updatedate < DATE_ADD(NOW(),INTERVAL - 1 YEAR); 
DELETE FROM ticketdata WHERE ticketid NOT IN ( SELECT ticketID FROM tickets );
DELETE FROM timeslips WHERE ticketid NOT IN ( SELECT ticketID FROM tickets );
DELETE FROM Databasefails WHERE ticketid NOT IN ( SELECT ticketID FROM tickets );
DELETE FROM Databasealerts WHERE ticketid NOT IN ( SELECT ticketID FROM tickets ); 
DELETE FROM plugin_cw_ticket_failures WHERE ticketid NOT IN ( SELECT ticketID FROM tickets ); 
DELETE FROM Projects WHERE ticketid NOT IN ( SELECT ticketID FROM tickets );

how to purge “ticketdata” connectwise

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...