# How to restore a deleted ticket state

**URL:** <https://community.zammad.org/t/how-to-restore-a-deleted-ticket-state/643>\
**Category:** Technical assistance\
**Created:** [May 9, 2018, 7:25am UTC](https://community.zammad.org/t/how-to-restore-a-deleted-ticket-state/643 "2018-05-09T07:25:26Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![rschenkech](https://community.zammad.org/letter_avatar_proxy/v4/letter/r/87869e/32.png) [@rschenkech](https://community.zammad.org/u/rschenkech)\
**Post date:** [May 9, 2018, 7:25am UTC](https://community.zammad.org/t/how-to-restore-a-deleted-ticket-state/643/1 "2018-05-09T07:25:26Z")

</div>

### Infos:

- Used Zammad version: 2.4.x
- Used Zammad installation source: [https://ftp.zammad.com/zammad-latest.tar.gz](https://ftp.zammad.com/zammad-latest.tar.gz)
- Operating system: CentOs
- Browser + version: Google Chrome, Version 66.0.3359.139 (Offizieller Build) (64-Bit)

We accidently deleted default ticket states ‘Pending reminder’ and ‘Pending close’ (Using rails console - Ticket::State.find(X).destroy)

Is there a way to restore the default ticket states?

Many thanks!  
Ralf

---

<div class="post-metadata">

**Author:** ![MrGeneration](https://community.zammad.org/user_avatar/community.zammad.org/mrgeneration/32/9260_2.png) [@MrGeneration](https://community.zammad.org/u/MrGeneration)\
**Post date:** [May 9, 2018, 11:11am UTC](https://community.zammad.org/t/how-to-restore-a-deleted-ticket-state/643/2 "2018-05-09T11:11:29Z")

</div>

I think @anon29869905 or @martini can help at that point.

Took a look into the admin documentation, but I think it’s missing especially those parts. 🙂

---

<div class="post-metadata">

**Author:** ![anon29869905](https://community.zammad.org/letter_avatar_proxy/v4/letter/a/b782af/32.png) [@anon29869905](https://community.zammad.org/u/anon29869905)\
**Post date:** [May 9, 2018, 11:25am UTC](https://community.zammad.org/t/how-to-restore-a-deleted-ticket-state/643/3 "2018-05-09T11:25:21Z")

</div>

You can run `zammad run rails r db/seeds/ticket_states.rb`

This will create each default state that doesn’t exist.

---

<div class="post-metadata">

**Author:** ![rschenkech](https://community.zammad.org/letter_avatar_proxy/v4/letter/r/87869e/32.png) [@rschenkech](https://community.zammad.org/u/rschenkech)\
**Post date:** [May 14, 2018, 3:12pm UTC](https://community.zammad.org/t/how-to-restore-a-deleted-ticket-state/643/4 "2018-05-14T15:12:17Z")

</div>

Many thanks Thorsten

I tried that, but seems there are some constraints. Got a lot of error messages, starting:

 ![image](https://community.zammad.org/uploads/default/original/1X/9f9c961dfcebb4eb8e520cc02e905aeb0cc18eea.jpg)

cheers  
Ralf

---

<div class="post-metadata">

**Author:** ![anon29869905](https://community.zammad.org/letter_avatar_proxy/v4/letter/a/b782af/32.png) [@anon29869905](https://community.zammad.org/u/anon29869905)\
**Post date:** [May 22, 2018, 5:47pm UTC](https://community.zammad.org/t/how-to-restore-a-deleted-ticket-state/643/5 "2018-05-22T17:47:48Z")

</div>

Sorry for the delay. Please edit the file and add `UserInfo.current_user_id = 1` in the first line. You can remove it afterwards.

---

<div class="post-metadata">

**Author:** ![rschenkech](https://community.zammad.org/letter_avatar_proxy/v4/letter/r/87869e/32.png) [@rschenkech](https://community.zammad.org/u/rschenkech)\
**Post date:** [June 4, 2018, 9:13am UTC](https://community.zammad.org/t/how-to-restore-a-deleted-ticket-state/643/6 "2018-06-04T09:13:48Z")

</div>

Many thanks Thorsten

Very often in the community it has been mentioned that there will be a UI in order to be able to change/add status. What’s the status here?

Many thanks and cheers  
Ralf

---

<div class="post-metadata">

**Author:** ![system](https://community.zammad.org/uploads/default/original/1X/5c5afaea2d23f811dbec33cd4edb02fa29d3262f.png) [@system](https://community.zammad.org/u/system)\
**Post date:** [August 3, 2018, 9:13am UTC](https://community.zammad.org/t/how-to-restore-a-deleted-ticket-state/643/7 "2018-08-03T09:13:49Z")

</div>

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