[Solved] Why does OTRS reset TicketFreeText6 here?

Moderator: crythias

Post Reply
shostakovich
Znuny advanced
Posts: 146
Joined: 11 Apr 2011, 08:11
Znuny Version: 3.2.5

[Solved] Why does OTRS reset TicketFreeText6 here?

Post by shostakovich »

Hi,

this makes me crazy. I've got an event module "SetInfoQueue" which runs on Type- and QueueUpdate. What it does is, if TicketFreeText6 matches certain conditions, it has to set TicketFreeText6 to the Queuename.

Old value of TicketFreeText6 is "8. Organisatorische Queues::Posteingang". OK, now I change the queue to "1. Applikationen::Test", and this is what happens:

[History]
Misc Executing SetInfoQueue.pm.
Misc SetInfoQueue.pm: Entering IF...
TicketFreeTextUpdate Aktualisiert: FreeKey6=Info-Queue;FreeText6=1. Applikationen::Test;
Misc SetInfoQueue.pm: ENDIF and out...
TicketFreeTextUpdate Aktualisiert: FreeKey6=Info-Queue;FreeText6=8. Organisatorische Queues::Posteingang; ???? WUT?

Code: Select all

[code]    # get ticket data
    my %Ticket = $Self->{TicketObject}->TicketGet( TicketID => $Param{Data}->{TicketID} );

    $Self->{TicketObject}->HistoryAdd(
       TicketID     => $Param{Data}->{TicketID},
       CreateUserID => $Param{UserID},
       HistoryType  => 'Misc',
       Name         => 'Executing SetInfoQueue.pm.',
    );

    if ($Ticket{TicketFreeText6} !~ /.* (Applikationen|Infrastruktur)::/) {
       $Self->{TicketObject}->HistoryAdd(
          TicketID     => $Param{Data}->{TicketID},
          CreateUserID => $Param{UserID},
          HistoryType  => 'Misc',
          Name         => 'SetInfoQueue.pm: Entering IF...',
       );
       $Self->{TicketObject}->TicketFreeTextSet(
          TicketID => $Param{TicketID},
          UserID   => $Param{UserID},
          Key      => 'Info-Queue',
          Value    => $Ticket{Queue},
          Counter  => 6,
        );
       $Self->{TicketObject}->HistoryAdd(
          TicketID     => $Param{Data}->{TicketID},
          CreateUserID => $Param{UserID},
          HistoryType  => 'Misc',
          Name         => 'SetInfoQueue.pm: ENDIF and out...',
       );
    }
   return 1;
}

1;
So in the history we see, it performs the HistoryAdd and also sets ticketfreetext6, but why in gods name does OTRS immediately reset TicketFreeText6 to the old value? Do you have an idea about which process could trigger this? It definitely happens after my code is successfully applied.

TIA
Michael
Last edited by shostakovich on 02 Sep 2011, 15:48, edited 1 time in total.
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Why does OTRS reset TicketFreeText6 here?

Post by crythias »

It'd be a ticketEvent, perhaps, and likely related (?) to ITSM?
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
shostakovich
Znuny advanced
Posts: 146
Joined: 11 Apr 2011, 08:11
Znuny Version: 3.2.5

Re: Why does OTRS reset TicketFreeText6 here?

Post by shostakovich »

Thanks for your help. Ooops, I forgot - a few days ago I added the code to NotificationEvent.pm in the Custom branch. Solved. :D
Post Reply