[rt-users] How to modify the ticket # format?

Matt Simerson matt at corp.spry.com
Mon May 11 20:40:47 EDT 2009


On May 11, 2009, at 4:36 PM, Jay R. Ashworth wrote:

> ----- "Ken Crocker" <kfcrocker at lbl.gov> wrote:
>>    Correct. Plus, you may well run out of viable Ticket ID's. IF I>  
>> were
>> you. I would do my best to dissuade. Lots of luck.
>
> In a private message (for some reason, I expected to be on the wrong  
> side
> of this argument) I provided the OP with several concrete reasons  
> and examples
> as to why this is such a breathtakingly bad design choice, and he  
> should
> hold his breath until he turns blue if his management tries to make  
> him.
>
> :-)

Considering the current economic climate and the abundance of lightly  
skilled admins that would be willing to alter the RT DB schema to suit  
his suits wishes, perhaps an approach that doesn't involve turning  
blue would be advised.

Since every RT ticket already has the ticket ID & date, it would not  
be terribly difficult to hack at the SQL queries that create, search,  
and retrieve tickets. If you have the skills, hack the queries to  
manipulate the ticket ID into the preferred format. You could also  
create a custom table that maps the 'normal' RT ticket ID and the  
'preferred' ticket ID #.

Another option is writing a custom web interface to RT, using the REST  
API. Have the web application handle the mapping and presentation of  
ticket IDs to and from the desired format. It's greatly simplified by  
using RT::Client::REST.  I wrote one in only 387 lines of perl:

$ wc -l lib/Spry/Tickets.pm
      387 lib/Spry/Tickets.pm

$ grep '^sub' lib/Spry/Tickets.pm
sub new {
sub rt_connect {
sub rt_close_ticket {
sub rt_create_ticket {
sub rt_get_tickets {
sub rt_update_ticket {
sub _get_rt {

If perl isn't your cup of tea, write your web app in your favorite  
language and interface directly with the database. You'll have a bit  
more testing to do during future RT upgrades, but the RT schema is  
quite stable.

Either way, you'll have the ability to easily automate and radically  
alter how RT data is presented, thus appeasing the pointy haired man.

Matt




More information about the rt-users mailing list