
Hi, the otrs::itsm-documentation says that freetext-field 3-6 & 13-16 may not be in use if you install otrs::itsm, because they are used through otrs::itsm. So, if you have them in use, how do you move these fields to other fields. I just don't know. I could imagine to make DB-manipulations with updates on the table ticket (and to ensure data-consistence) on ticket_history, but GenericAgent would be the clearer way. Any ideas? Bye, Alex

Hi, I now wrote a GenericAgent-module which copies freetext-field - see attachments (I had to expand the suffix with .txt due to our security-sytems)... The job must be called with a hugh size-limit, e.g. GenericAgent.pl -c 'Kernel::Config::MoveFreeText' -l 100000 otherwise the job-execution will end after 3000 tickets which leads to unconsistent data. See also http://bugs.otrs.org/show_bug.cgi?id=2104 Look very detailed on the attachments to understand how it works - please understand that I'm not too detailed here. Usage of my scripts at you own risk - it worked for me on appr. 6000 tickets. Bye, Alex Alexander Scholler schrieb:
Hi,
the otrs::itsm-documentation says that freetext-field 3-6 & 13-16 may not be in use if you install otrs::itsm, because they are used through otrs::itsm.
So, if you have them in use, how do you move these fields to other fields. I just don't know.
I could imagine to make DB-manipulations with updates on the table ticket (and to ensure data-consistence) on ticket_history, but GenericAgent would be the clearer way.
Any ideas?
Bye, Alex _______________________________________________ OTRS mailing list: itsm - Webpage: http://otrs.org/ Archive: http://lists.otrs.org/pipermail/itsm To unsubscribe: http://lists.otrs.org/mailman/listinfo/itsm Support or consulting for your OTRS::ITSM system? => http://www.otrs.com/
# -- # This software comes with ABSOLUTELY NO WARRANTY. For details, see # the enclosed file COPYING for license information (GPL). If you # did not receive this file, see http://www.gnu.org/licenses/gpl.txt. # -- package Kernel::Config::MoveFreeText; use strict; use vars qw($VERSION @ISA @EXPORT %Jobs); require Exporter; @ISA = qw(Exporter); @EXPORT = qw(%Jobs); $VERSION = '$Revision: 1.9 $'; $VERSION =~ s/^\$.*:\W(.*)\W.+?$/$1/; # ----------------------------------------------------------------------- # config options # ----------------------------------------------------------------------- %Jobs = ( # -- # [name of job] -> send escalation notifications # -- ##_ 'MoveFreeText' => { # new ticket properties New => { Module => 'Kernel::System::GenericAgent::MoveFreeText', FromFreeText => '5', ToFreeText => '12', # Swap => 1, }, }, ); # ----------------------------------------------------------------------- # end of config options # ----------------------------------------------------------------------- 1; # -- # Kernel/System/GenericAgent/MoveFreeText.pm - generic agent freetext movement # -- # $Id: MoveFreeText.pm,v 0.1 2007/07/26 10:00:00 scholler Exp $ # -- # This software comes with ABSOLUTELY NO WARRANTY. For details, see # the enclosed file COPYING for license information (GPL). If you # did not receive this file, see http://www.gnu.org/licenses/gpl.txt. # -- ##_ package Kernel::System::GenericAgent::MoveFreeText; use strict; use vars qw(@ISA $VERSION); $VERSION = '$Revision: 1.2 $'; $VERSION =~ s/^\$.*:\W(.*)\W.+?$/$1/; # -- sub new { my $Type = shift; my %Param = @_; # allocate new hash for object my $Self = {}; bless ($Self, $Type); # check needed objects foreach (qw(DBObject ConfigObject LogObject TicketObject TimeObject)) { $Self->{$_} = $Param{$_} || die "Got no $_!"; } # 0=off; 1=on; $Self->{Debug} = $Param{Debug} || 0; return $Self; } # -- sub Run { my $Self = shift; my %Param = @_; # check needed param if (!$Param{New}->{"FromFreeText"} or $Param{New}->{"FromFreeText"} !~ /^\d{1,2}$/) { $Self->{LogObject}->Log( Priority => 'error', Message => "Need FromFreeText param (digit within range of freetext-fields) for GenericAgent module!", ); return; } if (!$Param{New}->{"ToFreeText"} or $Param{New}->{"ToFreeText"} !~ /^\d{1,2}$/) { $Self->{LogObject}->Log( Priority => 'error', Message => "Need ToFreeText param (digit within range of freetext-fields) for GenericAgent module!", ); return; } # get ticket data my %Ticket = $Self->{TicketObject}->TicketGet(TicketID => $Param{"TicketID"}, UserID => 1); my $f = $Param{New}->{"FromFreeText"}; my $t = $Param{New}->{"ToFreeText"}; my $kf = $Ticket{"TicketFreeKey$f"}; my $tf = $Ticket{"TicketFreeText$f"}; my $kt = $Ticket{"TicketFreeKey$t"}; my $tt = $Ticket{"TicketFreeText$t"}; # copy FromFreeText to ToFreeText $Self->{TicketObject}->TicketFreeTextSet( Counter => $t, Key => $kf, Value => $tf, TicketID => $Ticket{"TicketID"}, UserID => 1, ); # set Key/Value to "" or swap value if (defined $Param{New}->{"Swap"}) in FromFreeText $Self->{TicketObject}->TicketFreeTextSet( Counter => $f, Key => ($Param{New}->{"Swap"})?$kt:"", Value => ($Param{New}->{"Swap"})?$tt:"", TicketID => $Ticket{"TicketID"}, UserID => 1, ); return 1; } # -- 1;
participants (1)
-
Alexander Scholler