I'm trying to write a scrip that removes the requestor of a new ticket
if the requestor's email address is in a specific "no-reply" group in
RT (for things like Nagios messages that don't need replies), and I
think I'm getting confused when trying to make it work. What I have
so far (below) doesn't have any effect on new tickets. Any ideas what
I'm messing up?
==Condition==
my @exceptionGroups = ('no-reply');
my $principalobj = RT::Principal->new($RT::SystemUser);
$principalobj->Load($self->TransactionObj->CreatorObj->Id);
my $transactionType = $self->TransactionObj->Type;
if ($transactionType eq 'Create') {
foreach (@exceptionGroups) {
my $groupobj = RT::Group->new($RT::SystemUser);
$groupobj->LoadUserDefinedGroup($_);
if ($groupobj->HasMemberRecursively($principalobj)) {
return 1;
}
}
}
return 0;
==Action==
my $principalobj = RT::Principal->new($RT::SystemUser);
$principalobj->Load($self->TransactionObj->CreatorObj->Id);
my ($status, $msg) = $self->TicketObj->DeleteWatcher(Type =>
"Requestor", PrincipalId => $principalobj);
return $status;
_______________________________________________
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
Community help: http://wiki.bestpractical.com
Commercial support: [email protected]
Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
Buy a copy at http://rtbook.bestpractical.com