Non-consecutive ticket numbers

Should ticket numbers be consecutive? Or doesn’t it matter at all?

Some people requested the date of creation as part of the ticket
number, and I wonder if I can increase the sequence number to YYMMDD00
every night (or even YYMMDD000).

Florian Weimer Weimer@CERT.Uni-Stuttgart.DE
University of Stuttgart http://CERT.Uni-Stuttgart.DE/people/fw/
RUS-CERT +49-711-685-5973/fax +49-711-685-5898

Should ticket numbers be consecutive? Or doesn’t it matter at all?

Doesn’t matter at all, except that RT::ticket::Create expects the
database to do the right thing.

Some people requested the date of creation as part of the ticket
number, and I wonder if I can increase the sequence number to YYMMDD00
every night (or even YYMMDD000).

We use YYYYMMDDnnn, which required changing a bunch of fields from
integer to bigint. You should be able to get around that with just
YYMMDD000 (which I’d recommend; one barrage of spam or mail problem
and you’ve got 100 tickets easy.)

For MySQL, all you should need to do is run this at midnight:

TICKET=$(date +%y%m%d000)
mysql --user=rt_user --pass=PASSWORD rt2
-e “ALTER TABLE Tickets AUTO_INCREMENT = ${TICKET};”

Oh, wait, you’ll hit a problem there. RT (well, MySQL) does expect
tickets to be integers, not strings, so with YYMMDDnnn, you’ll
get a current ticket number of “20528001”, not “020528001”. There’s
something to be said for YYYY – if you want, I’ll send an updated
schema for the bigint ticket numbers. (I think I’ve caught them
all.) The four-digit year is %Y instead of %y in the date command in
the bit above.

Hope this helps,

-Rich

Rich Lafferty --------------±----------------------------------------------
Ottawa, Ontario, Canada | Save the Pacific Northwest Tree Octopus!
http://www.lafferty.ca/ | Save The Pacific Northwest Tree Octopus
rich@lafferty.ca -----------±----------------------------------------------