KACE How to use SQL to delete all tickets from submitter postmaster@domain.xx
After a mail loop I have more than 10k tickets from postmaster@domain.xx.
I would like to to be able to delete them in a easy way, and not use GUI to delete 150 tickets at the time.
-
The SQL database is read access only. You may be able to talk support into doing it for you but you will not be able to do it that way. - mramsdell 9 years ago
Answers (1)
I had this same issue and handled it with a ticket rule. First you need to find the USERID for the postmaster@domain.xx account (KACE should have created a user for that email address) and you'll need to place it in the queries below where I have <userid for postmaster@domain.xx>.
Use the rule wizard to create a blank rule (just leave the defaults for the wizard). Delete the contents of the select query and change it to the following:
DELETE FROM HD_TICKET_CHANGE WHERE USER_ID = <userid for postmaster@domain.xx>
So if your userid is 1235 the query would be
DELETE FROM HD_TICKET_CHANGE WHERE USER_ID = 1235
Clear the other checkboxes for the rule, save it and run it.
That statement will clear the ticket comments from postmaster. To delete tickets with postmaster as the submitter:
DELETE FROM HD_TICKET WHERE OWNER_ID = <userid for postmaster@domain.xx>