2014-01-28 39 views
0

我希望能够发送电子邮件给以前的所有者,当有人窃取一张票,目前与请求跟踪器我可以发送电子邮件给新的所有者,但不是以前所有者。请求跟踪器:通知以前的所有者

似乎有一个扩展,让这个不过它不支持RT 4.2(我用4.2.1):http://metacpan.org/pod/RT::Extension::NotifyOwners

任何帮助,将不胜感激,如果有人有此设置或使用在RT 4.2上的扩展会很棒。我非常肯定你可以通过自定义操作来做到这一点,但我对这方面的知识还不够。从日志

错误:

 
[email protected]:/home/steven# cpanm RT::Extension::NotifyOwners 
--> Working on RT::Extension::NotifyOwners 
Fetching http://www.cpan.org/authors/id/I/ID/IDN/RT-Extension-NotifyOwners-0.02.tar.gz ... OK 
Configuring RT-Extension-NotifyOwners-0.02 ... N/A 
! Configure failed for RT-Extension-NotifyOwners-0.02. See /root/.cpanm/work/1390880978.19447/build.log for details. 
[email protected]:/home/steven# tail /root/.cpanm/work/1390880978.19447/build.log 
Unpacking RT-Extension-NotifyOwners-0.02.tar.gz 
Entering RT-Extension-NotifyOwners-0.02 
Checking configure dependencies from META.yml 
Checking if you have ExtUtils::MakeMaker 6.42 ... Yes (6.82) 
Configuring RT-Extension-NotifyOwners-0.02 
Running Makefile.PL 
Cannot find the location of RT.pm that defines $RT::LocalPath in: inc /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/sh      are/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl . /opt/      rt3/lib /opt/lib/rt3 /opt/lib /usr/local/rt3/lib /usr/local/lib/rt3 /usr/local/lib /home/rt3/lib /home/lib/rt3 /home/lib      /usr/rt3/lib /usr/lib/rt3 /usr/lib /sw/rt3/lib /sw/lib/rt3 /sw/lib 
Path to directory containing your RT.pm: 
-> N/A 
-> FAIL Configure failed for RT-Extension-NotifyOwners-0.02. See /root/.cpanm/work/1390880978.19447/build.log for details. 
+0

你提到的扩展不支持RT 4.2。你试过了吗?你看到了什么错误或日志消息? –

+0

用日志编辑的帖子(链接到更易读的格式:http://pastebin.com/r4g5NAS7) – MrWhippy

+0

它没有找到你的RT安装。尝试将RTHOME环境变量设置为RT基目录,通常为/ opt/rt4。 –

回答

0

您可以通过脚本和模板实现这一目标。以股代息On Steal Notify Old Owner应该是这样的:

my $field = $self->TransactionObj->Field; 
my $type = $self->TransactionObj->Type; 

return 0 unless defined($field); 
return 0 unless $field eq 'Owner'; 
return 0 unless $type eq 'Set'; 
return 0 if $self->TransactionObj->OldValue == $self->TransactionObj->Creator; 

return 1 if $self->TransactionObj->OldValue != RT::Nobody()->id(); 

return 0; 

条件的纸条User defined行动应该Notify Other Recipients,例如Stolen Ticket模板

Perl的模板Stolen Ticket会再比如这一个:

To: {my $user = new RT::User($RT::SystemUser); 
$user->Load($Transaction->OldValue); $user->EmailAddress() || $Transaction->OldValue} 
Subject: [{$rtname } #{ $Ticket->Id() }] Stolen: { $Ticket->Subject() } 

URL: https://rt.example.com/rt/Ticket/Display.html?id={ $Ticket->id } 

A ticket you owned: 
    { $Ticket->Subject() } 

has been taken by {$Ticket->OwnerObj->RealName} <{$Ticket->OwnerObj->EmailAddress}>.