[rt-users] Scrip Issue: Notify other recipients if not created by queue manager

Matt Brennan brennanma at gmail.com
Fri Jul 15 17:36:30 EDT 2011


Greetings,

  This one has been stumping me for a week now so I figure it's time
to ask for help. I am trying to create two scrips, neither of which I
can get to work. The first and more important is to notify "other
recipients" only if the ticket was not submitted by a member of the
queue managers group for the appropriate queue.

  I.E. A user submits a ticket in the ServerAdmin queue, the queue
managers for that queue get notified. However, if I submit a ticket in
that queue, the rest of the queue managers should not be notified.
Notifying the group is not an issue, however whenever I submit a
ticket it still causes notification. The User Defined condition I have
is:

if ($self->TransactionObj->Type eq 'Create') {
  my $GroupObj = RT::Group->new( $RT::SystemUser );
  $GroupObj->LoadUserDefinedGroup( $self->TicketObj->QueueObj->Name );
  if ($GroupObj->HasMemberRecursively( $self->CurrentUser->PrincipalObj )) {
    return 0;
  }
  return 1;
}

The LoadUserDefinedGroup paramater should be correct -- I have the
group for queue managers named identical to the queue.

Thanks,
Matt Brennan



More information about the rt-users mailing list