Prefix ticket number

English! place to talk about OTRS development, programming and coding

Moderator: tto

Post Reply
OTRS newbie
Posts: 36
Joined: 17 Apr 2014, 23:38
OTRS Version?: 3.3.5
Real Name: Clinton

Prefix ticket number

Post by cbruigom » 21 Sep 2014, 01:08

Is it possible to prefix the ticket number with which ever queue that ticket is in?

This is a specific customer requirement, and although it doesnt seem useful they still require it. I currently found this thread which seems like it can be done however havent managed to get it right: ... 39232.html

I am on version 3.3.5 and the files on the post where from a number of years ago so I havent replaced them into my directories, but rather made copies of the existing files in my directories and then tried to ammend parts which are from the files added in the post. I have made a copy of in /System/PostMaster and of in /System/Ticket/Number. I have added the following code in each (lines in bold):
my $NewTn = $Self->{TicketObject}->TicketCreateNumber( QueueID => $QueueID);
my %Queue = $Self->{QueueObject}->QueueGet( ID => $Param{QueueID} );
my $Prefix = "";
if ( $Queue{Comment} )
$Prefix = uc( $Queue{Comment} ); # all uppercase
$Prefix =~ y/A-Z/ /cs; # remove non A-Z chars
$Prefix =~ s/\s//g; # remove spaces
$Prefix = substr( $Prefix, 0, 5 ); # only 5 chars max
if ($Prefix eq '' )
$Prefix = "U";
return $Prefix . "-" . $Tn;

The post also talks about updating the with:
$Self->{'Ticket::NumberGenerator'} = 'Kernel::System::Ticket::Number::AutoIncrementQueueComment';

But once I do that my OTRS web page no longer loads. I also recieve this error in the syslog:
Global symbol "%Param" requires explicit package name at /opt/otrs//Kernel/System/Ticket/Number/ line 98.

Anyone got some ideas for me? Or other ways of achieving this?

User avatar
OTRS expert
Posts: 66
Joined: 08 Jan 2015, 17:01
OTRS Version?: 5.0.10
Real Name: Egareg JAOUEN
Company: Elitt

Re: Prefix ticket number

Post by elitt » 25 Jul 2017, 11:36


I re-open this message as I have to install an other OTRS server.
My agents would love to have a prefix ticket number specific per queue. Is it possible ? And how ?

I wonder if dynamic fields could answer conveniently to this demand ?

It is possible to modify the code, but I would like to have a solution that not breaks upon each update.
OTRS v5.0.10 on Fedora25 with posgreSQL 9.4.9 database

Post Reply