Changing NumberGenerator on running system

Moderator: crythias

Locked
vkandersv
Znuny newbie
Posts: 36
Joined: 07 Mar 2011, 18:32
Znuny Version: 3.0.6

Changing NumberGenerator on running system

Post by vkandersv »

Hi,

I'm trying to change the ticket number format on an active system, from the default DateChecksum to AutoIncrement, and the change work for new tickets.

But when an customer replies on an existing open ticket that has the old number format, OTRS generates a new ticket instead of adding the reply to the open ticket.

I've changed:

Ticket::NumberGenerator to AutoInkrement
and
Ticket::NumberGenerator::CheckSystemID to No

Is there any more to change ?
--
ORTS 3.0.6, Linux, MySQL, ActiveDirectory integration for Customer.
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Changing NumberGenerator on running system

Post by crythias »

When you change how numbers are generated, you change how numbers are verified.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
Wolfgangf
Znuny ninja
Posts: 1029
Joined: 13 Apr 2009, 12:26
Znuny Version: 6.0.13
Real Name: Wolfgang Fürtbauer
Company: PBS Logitek GmbH
Location: Pinsdorf

Re: Changing NumberGenerator on running system

Post by Wolfgangf »

I did and modified the code of the new method to cover also the old method
Produktiv:
OTRS 6.0.13/ ITSM 6.0.13
OS: SUSE Linux (SLES 12, Leap), MySql 5.5.x, 5.6.x
Windows 2012 AD Integration (agents and customers), Nagios integration (incidents, CMDB), Survey, TimeAccounting
vkandersv
Znuny newbie
Posts: 36
Joined: 07 Mar 2011, 18:32
Znuny Version: 3.0.6

Re: Changing NumberGenerator on running system

Post by vkandersv »

Wolfgangf wrote:I did and modified the code of the new method to cover also the old method
Hi, thats interesting, do you mind sharing that code ? or perhaps giving some hints how you did it ?
--
ORTS 3.0.6, Linux, MySQL, ActiveDirectory integration for Customer.
Wolfgangf
Znuny ninja
Posts: 1029
Joined: 13 Apr 2009, 12:26
Znuny Version: 6.0.13
Real Name: Wolfgang Fürtbauer
Company: PBS Logitek GmbH
Location: Pinsdorf

Re: Changing NumberGenerator on running system

Post by Wolfgangf »

Hi,

no problem

I used the "Default" NumberGenerator Date first and the decided to change to Autoincrement

So I modified the /opt/otrs/Kernel/System/Ticket/Number/Autoincrement.pm accordingly:

Code: Select all

sub GetTNByString {
    my ( $Self, $String ) = @_;
    if ( !$String ) {
        return;
    }

  ...
    # -------------------------------
    # check previous setting: Date
    # -------------------------------

    #            $Self->{LogObject}->Log(
    #                Priority => 'information',
    #                Message  => "Subject string: $String",
    #            );

    if ( $String =~ /\Q$TicketHook$TicketHookDivider\E(\d{4,10}$SystemID\d{1,40})/i ) {
        return $1;
    }

    # check default setting
    if ( $String =~ /\Q$TicketHook\E:\s{0,2}(\d{4,10}$SystemID\d{1,40})/i ) {
        return $1;
    }


    # ----------------------------------------
    # check ticket number: Autoincrement
    #-----------------------------------------

    if ( $String =~ /\Q$TicketHook$TicketHookDivider\E($SystemID\d{$MinSize,$MaxSize})/i ) {
        return $1;
    }

    if ( $String =~ /\Q$TicketHook\E:\s{0,2}($SystemID\d{$MinSize,$MaxSize})/i ) {
please find here the full module
AutoIncrement.pm.txt
You do not have the required permissions to view the files attached to this post.
Produktiv:
OTRS 6.0.13/ ITSM 6.0.13
OS: SUSE Linux (SLES 12, Leap), MySql 5.5.x, 5.6.x
Windows 2012 AD Integration (agents and customers), Nagios integration (incidents, CMDB), Survey, TimeAccounting
vkandersv
Znuny newbie
Posts: 36
Joined: 07 Mar 2011, 18:32
Znuny Version: 3.0.6

Re: Changing NumberGenerator on running system

Post by vkandersv »

Hi Wolfgang,

Really great! This worked like a charm! Cool, and thanks very much!
Wolfgangf wrote:Hi,

no problem

I used the "Default" NumberGenerator Date first and the decided to change to Autoincrement
--
ORTS 3.0.6, Linux, MySQL, ActiveDirectory integration for Customer.
Wolfgangf
Znuny ninja
Posts: 1029
Joined: 13 Apr 2009, 12:26
Znuny Version: 6.0.13
Real Name: Wolfgang Fürtbauer
Company: PBS Logitek GmbH
Location: Pinsdorf

Re: Changing NumberGenerator on running system

Post by Wolfgangf »

my pleasure! Glad I could help
Produktiv:
OTRS 6.0.13/ ITSM 6.0.13
OS: SUSE Linux (SLES 12, Leap), MySql 5.5.x, 5.6.x
Windows 2012 AD Integration (agents and customers), Nagios integration (incidents, CMDB), Survey, TimeAccounting
prrole
Znuny newbie
Posts: 2
Joined: 27 Jul 2011, 21:10
Znuny Version: 3
Real Name: Per Ole Klemetsrud
Company: GIG Networks AS

Re: Changing NumberGenerator on running system

Post by prrole »

Thanks for this - saved us a lot of trouble for sure!
Locked