Changing default objects

Hey,

I just wanted to know, if it´s possible to change/edit the default objects.
I´d like to add different kinds of “state”.

Used Zamad Version: 3.1.0
Operating System: Ubuntu 18.04.3 LTS

Greetings
Yumemiku

I’ll just leave this here:
https://docs.zammad.org/en/latest/console/working-on-tickets.html

Technically you can change any object via rails console, however, I strongly advise not to do so if it’s not documented. If you do and something breaks, we’re not able to help you.

Can I only change objects via rails console?
I found the file where all objects are listed. But I can´t edit it. ( zammad/db/seeds/object_manager_attributes.rb)
The easiest way would be changing the “editable” attribute to “true”.

If they are protected inside the UI, yes.

Please see my statement above.
This is highly experimental on your end and might lead to issues nobody can forecast.
If you just want to add states, better stick with the console version as provided.

Again, just for double tabbing:
ANY change to source code or database settings away from our intended way is either not update safe or perfectly on your own risk. We will and cannot support you with that.

Hmm, okay too bad. Guess I better not edit stuff in the database or other places.
Do you have a rough idea when the feature to add different states like “waiting on approval” will be available?
The four default states are not enough for our purpose.

Greetings
Denise

You can add new states by yourself with rails… Here is how-to:

Working with ticket information — Zammad System Documentation documentation

You can also watch other requests in this community:

Howto add new Ticket State - #3 by Mr_P
Delayed change of ticket state - #15 by Mr_P

4 Likes

Thank you.
Your Thread has helped me a lot!

One last question, at least I hope so.
How can I delete a state I created?

Edit:
I tried “DELETE /api/v1/ticket_states/ID” and it worked.
But if I create a new State the gap that was just created isn’t filled but skipped instead.
Is that a problem?

If I add new states via Rails I can’t update Zammad without further Problems correct?

This is imho a pretty bad idea, because you’ll need to ensure that the said state is not set in ANY ticket.

Yes it is.
Running the “make states available to UI” commands should help:
https://docs.zammad.org/en/latest/console/working-on-tickets.html#make-new-states-available-to-ui

No, that’s not correct. States are saved within the database which makes them update safe.

I wouldn’t delete the status either. You have the possibility to edit it or set it to inactive (rails)… If problems occur, you can reactivate it.

Ticket::State.create_or_update (name: ‘nameofstate’, active: false)

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