Hi,
how can an agent fire the event Escalationresponsetimestop? I mean, is there an action in Ticket Details Panel firing the event Escalationresponsetimestop?
Thanks a lot
[SOLVED] Escalationresponsetimestop event trigger
Moderator: crythias
[SOLVED] Escalationresponsetimestop event trigger
Last edited by nautilus on 30 Aug 2016, 18:02, edited 3 times in total.
Re: Escalationresponsetimestop event trigger
Hi,
write a external article (phone outbound, reply or external note)
Flo
write a external article (phone outbound, reply or external note)
Flo
OTRS 2025 SILVER (Prod)
OTRS 2025 auf Debian 12 (Test)
Znuny 7.x latest version testing auf Debian 12
-- Ich beantworte keine Forums-Fragen PN - No PN please
I won't answer to unfriendly users any more. A greeting and regards are just polite.
OTRS 2025 auf Debian 12 (Test)
Znuny 7.x latest version testing auf Debian 12
-- Ich beantworte keine Forums-Fragen PN - No PN please
I won't answer to unfriendly users any more. A greeting and regards are just polite.
Re: Escalationresponsetimestop event trigger
Thanks,
now I would like to try something different: i.e. executing a custom module with admin GUI -> Generic Agent -> job
So I have followed these steps:
1) added a new job executing custom module GAModules::TriggerTicketEscalationResponseTimeStop
2) created a new perl module TriggerTicketEscalationResponseTimeStop.pm in /opt/otrs/Custom/GAModules/
3) copied /opt/otrs/Kernel/System/Ticket.pm in /opt/otrs/Custom/Kernel/System/Ticket.pm
3) added a new sub in /opt/otrs/Custom/Kernel/System/Ticket.pm just before section # COMPAT: to OTRS 1.x and 2.x (can be removed later)
User tests are positives
I am not a perl programmer, so suggestions are welcome!
now I would like to try something different: i.e. executing a custom module with admin GUI -> Generic Agent -> job
So I have followed these steps:
1) added a new job executing custom module GAModules::TriggerTicketEscalationResponseTimeStop
2) created a new perl module TriggerTicketEscalationResponseTimeStop.pm in /opt/otrs/Custom/GAModules/
Code: Select all
#!/usr/bin/perl
# This module is triggered by a generic agent and will set
# the current time to a dynamic field
package GAModules::TriggerTicketEscalationResponseTimeStop;
use strict;
use warnings;
use utf8;
use lib '/opt/otrs/';
use lib '/opt/otrs/Kernel/cpan-lib';
use lib '/opt/otrs/Custom';
sub new {
my ( $Type, %Param ) = @_;
# allocate new hash for object
my $Self = {%Param};
bless( $Self, $Type );
return $Self;
}
sub Run {
my ( $Self, %Param ) = @_;
my $TicketObject= $Kernel::OM->Get('Kernel::System::Ticket');
my ($OwnerID, $Owner) = $TicketObject->OwnerCheck(
TicketID => $Param{TicketID},
);
my $Success = $TicketObject->TicketEscalationResponseTimeStop(
TicketID => $Param{TicketID},
UserID => $OwnerID,
);
}
1;
3) added a new sub in /opt/otrs/Custom/Kernel/System/Ticket.pm just before section # COMPAT: to OTRS 1.x and 2.x (can be removed later)
Code: Select all
=item TicketEscalationResponseTimeStop()
set ticket escalation response time to zero
my $Success = $TicketObject->TicketEscalationResponseTimeStop(
TicketID => $Param{TicketID},
UserID => $Param{UserID},
);
=cut
sub TicketEscalationResponseTimeStop {
my ( $Self, %Param ) = @_;
# check needed stuff
for my $Needed (qw(TicketID UserID)) {
if ( !defined $Param{$Needed} ) {
$Kernel::OM->Get('Kernel::System::Log')->Log(
Priority => 'error',
Message => "Need $Needed!"
);
return;
}
}
my %Ticket = $Self->TicketGet(
TicketID => $Param{TicketID},
UserID => $Param{UserID},
DynamicFields => 0,
);
# get database object
my $DBObject = $Kernel::OM->Get('Kernel::System::DB');
# update escalation times with 0
my %EscalationTimes = (
EscalationResponseTime => 'escalation_response_time',
);
TIME:
for my $Key ( sort keys %EscalationTimes ) {
# check if table update is needed
next TIME if !$Ticket{$Key};
# update ticket table
$DBObject->Do(
SQL =>
"UPDATE ticket SET $EscalationTimes{$Key} = 0, change_time = current_timestamp, "
. " change_by = ? WHERE id = ?",
Bind => [ \$Param{UserID}, \$Ticket{TicketID}, ],
);
}
# clear ticket cache
$Self->_TicketCacheClear( TicketID => $Param{TicketID} );
return 1;
}
I am not a perl programmer, so suggestions are welcome!