How can I delete a ticket state on the console?

I have create a new ticket state with the zammad console zammad run rails c and the command Ticket::State.create_or_update.

How can I delete this ticket state?

I can get all informations for this ticket state with the command Ticket::State.find(12). Can I delete this state maybe with Ticket::State.find(12).delete

Thank you for your answers

Close :wink:

DANGEROUS OPERATION

Ticket::State.find(12).destroy

Dear future anon finding this thread during a search for deletion of states…

Please be advised that above mentioned methods are dangerous and not recommended.
If you want to remove existing states from Zammad, you’ll need to ensure that the said state is no longer referenced in any existing ticket.

Ignoring references may draw your Zammad instance at least partially broken.
This can cause broken UI up to non functioning service.

Please - don’t do it if you’re not absolutely sure what you’re doing!

Edit:
@awedor I was so keen and edited your article to hide the seeked information by default.
I did this by hoping to save copy cats from nuking their installations. I hope you don’t mind. :slight_smile:

1 Like

Yes I should have added a warning myself, good idea to hide this :wink:

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.