[rt-users] Help with code identifying QueueWatcher AdminCc

Kevin Falcone falcone at bestpractical.com
Fri Apr 29 12:21:05 EDT 2011


On Fri, Apr 29, 2011 at 09:17:44AM -0700, Kenneth Crocker wrote:
>    Got it. Thanks. I think I'm getting a LITTLE better at this, believe it or not.

Great.  I would love IsWatcher to search Queue watcher groups also,
but it's not something I've even sketched code for.

> 
>    On Thu, Apr 28, 2011 at 8:09 PM, Kevin Falcone <[1]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.
> 
> References
> 
>    Visible links
>    1. mailto:falcone at bestpractical.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20110429/49efdf2e/attachment.sig>


More information about the rt-users mailing list