Multiple responsibles or watchers in a ticket?
Moderator: crythias
Multiple responsibles or watchers in a ticket?
Hi,
I'd like to know if there is a way to set multiple responsible agents to a ticket, so that they may follow all the ticket actions, or to add them automatically to the watchlist. Is this possible?
I'd like to know if there is a way to set multiple responsible agents to a ticket, so that they may follow all the ticket actions, or to add them automatically to the watchlist. Is this possible?
OTRS 4!
Re: Multiple responsibles or watchers in a ticket?
I may have found a way through the ticket event module, but i can't get it working, any ideas??
In config.pm i added:
$SELF->{'Ticket::EventModulePost'}->{'TicketCreateSuscribe'}={module=>'Kernel::System::Ticket::Event::TicketCreateSuscribe'};
The package:
In config.pm i added:
$SELF->{'Ticket::EventModulePost'}->{'TicketCreateSuscribe'}={module=>'Kernel::System::Ticket::Event::TicketCreateSuscribe'};
The package:
Code: Select all
# --
# Kernel/System/Ticket/Event/TicketCreateSuscribe.pm - test event module
# Copyright (C) 2001-2011 xxx, http://otrs.org/
# --
# $Id: Test.pm,v 1.12 2011-11-25 10:14:18 mg Exp $
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (AGPL). If you
# did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
# --
package Kernel::System::Ticket::Event::TicketCreateSuscribe;
use strict;
use warnings;
use vars qw($VERSION);
$VERSION = qw($Revision: 1.12 $) [1];
sub new {
my ( $Type, %Param ) = @_;
# allocate new hash for object
my $Self = {};
bless( $Self, $Type );
# get needed objects
for (qw(ConfigObject TicketObject LogObject UserObject CustomerUserObject SendmailObject)) {
$Self->{$_} = $Param{$_} || die "Got no $_!";
}
return $Self;
}
sub Run {
my ( $Self, %Param ) = @_;
# check needed stuff
for (qw(Data Event Config)) {
if ( !$Param{$_} ) {
$Self->{LogObject}->Log( Priority => 'error', Message => "Need $_!" );
return;
}
}
for (qw(TicketID)) {
if ( !$Param{Data}->{$_} ) {
$Self->{LogObject}->Log( Priority => 'error', Message => "Need $_ in Data!" );
return;
}
}
if ( $Param{Event} eq 'TicketCreate' ) {
my %Ticket = $Self->{TicketObject}->TicketGet(
TicketID => $Param{Data}->{TicketID},
DynamicFields => 0,
);
if ( $Ticket{Type} eq 'DEMANDE DE SERVICE' ) {
#we start doing stuff
# trigger event
$Self->{TicketObject}->TicketWatchSubscribe(
TicketID => $Param{TicketID},
WatchUserID => $Param{UserID},
UserID => $Param{UserID},
);
# add history
$Self->HistoryAdd(
TicketID => $Param{TicketID},
CreateUserID => $Param{UserID},
HistoryType => 'Subscription to watchlist',
Name => "\%\%$User{UserFirstname} $User{UserLastname} ($User{UserLogin})",
);
return 1;
}
}
1;
Last edited by did12345 on 25 Sep 2013, 14:04, edited 2 times in total.
OTRS 4!
-
- Znuny guru
- Posts: 5018
- Joined: 13 Mar 2011, 09:54
- Znuny Version: 6.0.x
- Real Name: Renée Bäcker
- Company: Perl-Services.de
- Contact:
Re: Multiple responsibles or watchers in a ticket?
Please use the [ code ]-Tags...
Your config should look like
$SELF -> $Self
module -> Module
added: Event
I didn't check the Perl module...
Your config should look like
Code: Select all
$Self->{'Ticket::EventModulePost'}->{'111-TicketCreateSuscribe'} = {
Module => 'Kernel::System::Ticket::Event::TicketCreateSuscribe',
Event => 'TicketCreate',
};
module -> Module
added: Event
I didn't check the Perl module...
Last edited by reneeb on 11 Jun 2014, 13:05, edited 1 time in total.
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
Re: Multiple responsibles or watchers in a ticket?
Thank you very much i'll check it out, i corrected the postreneeb wrote:Please use the$SELF -> $SelfCode: Select all
-Tags... Your config should look like [code]$Self->{'Ticket::EventModulePost'}->{'111-TicketCreateSuscribe'} = { Module => 'Kernel::System::Ticket::Event::TicketCreateSuscribe', Event => 'TicketCreate', };
module -> Module
added: Event
I didn't check the Perl module...
OTRS 4!
-
- Znuny guru
- Posts: 5018
- Joined: 13 Mar 2011, 09:54
- Znuny Version: 6.0.x
- Real Name: Renée Bäcker
- Company: Perl-Services.de
- Contact:
Re: Multiple responsibles or watchers in a ticket?
Any messages in the log files?
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
Re: Multiple responsibles or watchers in a ticket?
nothing! I tried correcting the module so that it could get a certain ticket type and then suscribe the user to the watcher list... but it still does not work...reneeb wrote:Any messages in the log files?
i tried this with $PARAM {typeID}
the "corrected" code of the module is
Code: Select all
# --
# Kernel/System/Ticket/Event/TicketCreateSuscribe - test event module
package Kernel::System::Ticket::Event::TicketCreateSuscribe;
use strict;
use warnings;
use vars qw($VERSION);
$VERSION = qw($Revision: 1.12 $) [1];
sub new {
my ( $Type, %Param ) = @_;
# allocate new hash for object
my $Self = {};
bless( $Self, $Type );
# get needed objects
for (qw(ConfigObject TicketObject LogObject UserObject CustomerUserObject SendmailObject TypeID UserID)) {
$Self->{$_} = $Param{$_} || die "Got no $_!";
}
return $Self;
}
sub Run {
my ( $Self, %Param ) = @_;
# check needed stuff
for (qw(Data Event Config)) {
if ( !$Param{$_} ) {
$Self->{LogObject}->Log( Priority => 'error', Message => "Need $_!" );
return;
}
}
for (qw(TicketID)) {
if ( !$Param{Data}->{$_} ) {
$Self->{LogObject}->Log( Priority => 'error', Message => "Need $_ in Data!" );
return;
}
}
if ( $Param{Event} eq 'TicketCreate' ) {
my %Ticket = $Self->{TicketObject}->TicketGet(
TicketID => $Param{Data}->{TicketID},
DynamicFields => 0,
);
if ( $Param{TypeID} eq '15') {
#we start doing stuff
# trigger event
$Self->{TicketObject}->TicketWatchSubscribe(
TicketID => $Param{TicketID},
WatchUserID => $Param{UserID},
UserID => $Param{UserID},
);
# add history
$Self->HistoryAdd(
TicketID => $Param{TicketID},
CreateUserID => $Param{UserID},
HistoryType => 'Subscription to watchlist',
Name => "\%\%$User{UserFirstname} $User{UserLastname} ($User{UserLogin})",
);
}
}
return 1;
}
1;
OTRS 4!
Re: Multiple responsibles or watchers in a ticket?
Did you get this to work for you?
-
- Moderator
- Posts: 10169
- Joined: 04 May 2010, 18:38
- Znuny Version: 5.0.x
- Location: SouthWest Florida, USA
- Contact:
Re: Multiple responsibles or watchers in a ticket?
Use a distribution list email address attached to the watcher agent.
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
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