[rt-users] ticket numbers

Joerg Herbert joerg at die-herberts.de
Sun Feb 20 18:22:49 EST 2005


On 20 Feb 2005 at 21:09, Chris Knipe wrote:

> Which database's auto_increment field do I change / set again in order
> to get RT to use specific IDs for tickets?
> 
> Say,
> 20050218xxxx (on 05/02/18)
> 20050219xxxx (on 05/02/19)
> etc.

First, a simple ALTER TABLE doesn't work, because it isn't supported 
with INNODB-Tables under mysql.

This ist what I use:
----
BEGIN WORK;
LOCK TABLES Tickets WRITE;
INSERT INTO Tickets (id) VALUES 
(DATE_FORMAT(CURRENT_DATE,'%Y%m%d00'));
DELETE FROM Tickets WHERE id = DATE_FORMAT(CURRENT_DATE,'%Y%m%d00');
UNLOCK TABLES;
COMMIT;
-----

With this Snippet you are limited to 99 Tickets a Day, because id is  
an Integer-Value. You should make shure that you have a spam-
filtering-Mechanism running before the tickets makes it into RT.

It would be nice, if such things would be possible "the API-Way", but 
I know that setting the Ticket-Number manually is not wanted ;)

-- 
Bye for now, 
Bis denne,
                   Joerg




More information about the rt-users mailing list