Prefix ticket number

English! place to talk about development, programming and coding
Post Reply
cbruigom
Znuny newbie
Posts: 36
Joined: 17 Apr 2014, 23:38
Znuny Version: 3.3.5
Real Name: Clinton

Prefix ticket number

Post by cbruigom »

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:
http://www.opensubscriber.com/message/o ... 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 NewTicket.pm in /System/PostMaster and of AutoIncrement.pm in /System/Ticket/Number. I have added the following code in each (lines in bold):

NewTicket.pl:
my $NewTn = $Self->{TicketObject}->TicketCreateNumber( QueueID => $QueueID);

AutoIncrement.pm
}
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 Config.pm 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/AutoIncrement.pm line 98.

Anyone got some ideas for me? Or other ways of achieving this?
elitt
Znuny newbie
Posts: 70
Joined: 08 Jan 2015, 17:01
Znuny Version: 5.0.10
Real Name: Egareg JAOUEN
Company: Elitt

Re: Prefix ticket number

Post by elitt »

Hi,

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