On Fri, Jul 15, 2011 at 05:36:30PM -0400, Matt Brennan wrote:
> 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 )) {You should $RT::Logger->error() out $self->CurrentUser information, it isn't who you think it is. $self->TransactionObj->CreatorObj->PrincipalObj is likely to be closer to what you want -kevin > 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 > > -------- > 2011 Training: http://bestpractical.com/services/training.html
pgpq0d5aOSZU4.pgp
Description: PGP signature
-------- 2011 Training: http://bestpractical.com/services/training.html
