[rt-users] Help with code identifying QueueWatcher AdminCc
Kenneth Crocker
kfcrocker at lbl.gov
Fri Apr 29 12:17:44 EDT 2011
Kevin,
Got it. Thanks. I think I'm getting a *LITTLE* better at this, believe it or
not.
Kenn
LBNL
On Thu, Apr 28, 2011 at 8:09 PM, Kevin Falcone <falcone at bestpractical.com>wrote:
> On Thu, Apr 28, 2011 at 03:47:40PM -0700, Kenneth Crocker wrote:
> > To List,
> >
> > I've got some code that I'm using to try and identify certain users as
> the Queue AdminCc. I
> > want to do this so I can stop sending emails to Queue AdminCc's when
> they are also the
> > Requestor or Owner. The code is as follows:
>
> If you want to check Queue AdminCc's not Ticket AdminCcs, you need to
> look at the queue ($ticket->QueueObj) not the $ticket
>
> $ticket->QueueObj->AdminCc will give you an RT::Group and you want to
> read about the HasMember method on groups
>
> -kevin
>
> >
> =======================================================================
> > # Initiate Email when Ticket Status is created and Requestor or Owner
> are not Queue AdminCc
> >
> > my $trans = $self->TransactionObj;
> > my $ticket = $self->TicketObj;
> > my $owner = $ticket->OwnerObj->EmailAddress;
> > my $requestor =
> $ticket->Requestors->UserMembersObj->First->EmailAddress;
> >
> > if ($ticket->IsWatcher(Type => 'AdminCc', EmailAddress => $owner) or
> > $ticket->IsWatcher(Type => 'AdminCc', EmailAddress => $requestor))
> > {
> > return 0;
> > }
> >
> > return ($trans->Type eq "Create");
> > return 0;
> > ==============================================================
> >
> > It always fails. I always get a couple emails going to the same
> person. I've tried using
> > PrincipalID and Name as the identifiers and still no joy.
> >
> > I've also checked the code in Queue_Overlay.pm and I can't seem to see
> (I'mbasically a perl
> > newbie) where the Queue AdminCc is differentiated from the Ticket
> AdminCc, which we NEVER use.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20110429/fd007d21/attachment.htm>
More information about the rt-users
mailing list