Kevin,<br><br>Actually, no. I didn't. but it still worked and now I'm wondering why. However, I made the change so that it is coded correctly. AHH! I see why it worked before. The "HasMamber" subroutine ends if it is called with an argument that isn't a PrincipalId. Since I didn't use an Id related to a correct object, it ended and since that scrip was an "Extra" notification that I wanted to drop under those circumstances, "HasMember" ending made it look like it worked. I double checked against the logs and yes, that code was wrong. I just checked it again and it worked without the error message.<br>
<br>Good catch, Kevin. Must be why they pay you the "big Bucks"! ;-).<br><br>Kenn<br>LBNL<br><br><div class="gmail_quote">On Mon, May 2, 2011 at 8:33 AM, Kevin Falcone <span dir="ltr"><<a href="mailto:falcone@bestpractical.com">falcone@bestpractical.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="im">On Fri, Apr 29, 2011 at 02:08:49PM -0700, Kenneth Crocker wrote:<br>
> Kevin,<br>
><br>
> Got it. This is what works:<br>
><br>
> Custom Condition:<br>
> # Initiate Email when Ticket is created & Requestor or Owner are NOT AdminCc<br>
><br>
> my $trans = $self->TransactionObj;<br>
> my $ticket = $self->TicketObj;<br>
> my $queue = $ticket->QueueObj;<br>
<br>
</div>That doesn't look quite right, since you can't call HasMember on a<br>
QueueObj. I assume you were doing $ticket->QueueObj->AdminCc to get a<br>
group?<br>
<br>
-kevin<br>
<div class="im"><br>
> my $owner = $ticket->OwnerObj->PrincipalID;<br>
> my $requestor = $ticket->Requestors->UserMembersObj->First->PrincipalId;<br>
><br>
> if ($queue->HasMember($owner) or<br>
> $queue->HasMember($requestor))<br>
> {<br>
> return 0;<br>
> }<br>
><br>
> return ($trans->Type eq "Create");<br>
> return 0;<br>
><br>
> Thanks for your help.<br>
><br>
> Kenn<br>
> LBNL<br>
><br>
</div><div class="im">> On Fri, Apr 29, 2011 at 9:40 AM, Kenneth Crocker <[1]<a href="mailto:kfcrocker@lbl.gov">kfcrocker@lbl.gov</a>> wrote:<br>
><br>
> Kevin,<br>
><br>
> HA! Well, as I'm sure you've noticed, the world of RT Users seem to find a LOT of things<br>
> they want to do that NO ONE could have planned for. I think it's a @#$%#$%^ good product.<br>
> There will ALWAYS be someone, including me, that would wish RT did things this way or that,<br>
> but you guys really do put out a helluva good product.<br>
><br>
> My forte has always been as a project leader (in design and QA) from large mainframe systems<br>
> on down to mini-computers (pre-cursor to PC's and Client-server systems) for 40 yrs, so it's<br>
> easy for me to look at something and have that perfect 20/20 vision that hindsight gives<br>
> you. If we all had those "well, I shoulda done it this way" ideas in the beginning, I'd be<br>
> willing to bet you would STILL get some bitching here or there. That's why someone create<br>
> the "version number x.xx" for software, he he.<br>
><br>
> Great job. I'm looking forward to playing with 4.0 soon.<br>
><br>
> Kenn<br>
> LBNL<br>
><br>
</div><div class="im">> On Fri, Apr 29, 2011 at 9:21 AM, Kevin Falcone <[2]<a href="mailto:falcone@bestpractical.com">falcone@bestpractical.com</a>> wrote:<br>
><br>
> On Fri, Apr 29, 2011 at 09:17:44AM -0700, Kenneth Crocker wrote:<br>
> > Got it. Thanks. I think I'm getting a LITTLE better at this, believe it or not.<br>
><br>
> Great. I would love IsWatcher to search Queue watcher groups also,<br>
> but it's not something I've even sketched code for.<br>
> ><br>
</div><div><div></div><div class="h5">> > On Thu, Apr 28, 2011 at 8:09 PM, Kevin Falcone <[1][3]<a href="mailto:falcone@bestpractical.com">falcone@bestpractical.com</a>> wrote:<br>
> ><br>
> > On Thu, Apr 28, 2011 at 03:47:40PM -0700, Kenneth Crocker wrote:<br>
> > > To List,<br>
> > ><br>
> > > I've got some code that I'm using to try and identify certain users as the Queue<br>
> AdminCc.<br>
> > I<br>
> > > want to do this so I can stop sending emails to Queue AdminCc's when they are also the<br>
> > > Requestor or Owner. The code is as follows:<br>
> ><br>
> > If you want to check Queue AdminCc's not Ticket AdminCcs, you need to<br>
> > look at the queue ($ticket->QueueObj) not the $ticket<br>
> ><br>
> > $ticket->QueueObj->AdminCc will give you an RT::Group and you want to<br>
> > read about the HasMember method on groups<br>
> > -kevin<br>
> > > =======================================================================<br>
> > > # Initiate Email when Ticket Status is created and Requestor or Owner are not Queue<br>
> > AdminCc<br>
> > ><br>
> > > my $trans = $self->TransactionObj;<br>
> > > my $ticket = $self->TicketObj;<br>
> > > my $owner = $ticket->OwnerObj->EmailAddress;<br>
> > > my $requestor = $ticket->Requestors->UserMembersObj->First->EmailAddress;<br>
> > ><br>
> > > if ($ticket->IsWatcher(Type => 'AdminCc', EmailAddress => $owner) or<br>
> > > $ticket->IsWatcher(Type => 'AdminCc', EmailAddress => $requestor))<br>
> > > {<br>
> > > return 0;<br>
> > > }<br>
> > ><br>
> > > return ($trans->Type eq "Create");<br>
> > > return 0;<br>
> > > ==============================================================<br>
> > ><br>
> > > It always fails. I always get a couple emails going to the same person. I've tried<br>
> using<br>
> > > PrincipalID and Name as the identifiers and still no joy.<br>
> > ><br>
> > > I've also checked the code in Queue_Overlay.pm and I can't seem to see (I'mbasically a<br>
> > perl<br>
> > > newbie) where the Queue AdminCc is differentiated from the Ticket AdminCc, which we<br>
> NEVER<br>
> > use.<br>
> ><br>
> > References<br>
> ><br>
> > Visible links<br>
</div></div>> > 1. mailto:[4]<a href="mailto:falcone@bestpractical.com">falcone@bestpractical.com</a><br>
><br>
> References<br>
><br>
> Visible links<br>
> 1. mailto:<a href="mailto:kfcrocker@lbl.gov">kfcrocker@lbl.gov</a><br>
> 2. mailto:<a href="mailto:falcone@bestpractical.com">falcone@bestpractical.com</a><br>
> 3. mailto:<a href="mailto:falcone@bestpractical.com">falcone@bestpractical.com</a><br>
> 4. mailto:<a href="mailto:falcone@bestpractical.com">falcone@bestpractical.com</a><br>
</blockquote></div><br>