Change next Ticket ID

Excuse me for not using the Template here! This questions is probably an easy one for a rails pro.

Can anyone tell me the rails command for changing a Tickets “id” field?

Thanks in advance

I have to change my question, I now found a way to change the ticket ID, altough it unfortunately didn’t solve my issue which is:

The ticket ids and ticket numbers differ by 30. For example a new ticket gets the Number 103334 but the ID is 103364. We had couple of issues last week with our server environment and think that the problem comes from there. But why and when exactly this issue started is not clear.

Is there any way to set the next ID that is created by the system to match the next number? OR change the next number to match the next ticket ID.

I tried to change the ticket number in the db then create a new ticket but it continues from the old values so i guess there has to be a “master counter”

For anyone else having the same issue here is the solution:

dangerzone

Log into your db (postgres) and display current counter
select * from ticket_counters;
id | content | generator
----±--------±----------
1 | 3374 | Increment
(1 row)

update value to last ticket value / the next one will be incremented
update ticket_counters
set content=3407
where id=1;

select * from ticket_counters;
id | content | generator
----±--------±----------
1 | 3407 | Increment
(1 row)

I’ve been forced to edit your post because it potentially endangers Zammad installations and is everything but suggested to do. Fiddling directly in Zammads database is a dangerous and potentially data bricking action.

We’ve had this topic on this board several times by now:
The ticket ID and number are two independent values and are never guaranteed to be or stay the same. This is perfectly normal and technically no issue at all unless you’re mixing those two values up.

Thank you for you response! That is good to know… I know the system worked fine but we were used to the fact that the id and number is always the same (meaning that the ticket number is also in the end of the url which makes it easyer to access). But I hope the counter won’t change that often since we never had this before.

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