[rt-users] scrip: how to check if correspondence from requestor

Gene LeDuc gleduc at mail.sdsu.edu
Thu Sep 13 17:05:59 EDT 2007


You're right, my scrip fires when the e-mail is from the originator of the 
ticket.  In our system, the originator is always the only requestor, so I 
equated "requestor" to "originator" when I read the original.

At 01:15 PM 9/13/2007, Ole Craig wrote:

>If a ticket is created by requestor Alice but with Bob and Carol as
>requestors also (e.g. Alice sent the ticket-opening email with a
>recipient list that included Bob and Carol):
>
>Won't "$Ticket->CreatorObj->Id == $CreatorId" only match on transactions
>initiated by Alice?
>
>If the intent is to fire on email from any of the Requestors (as opposed
>to email from the originator) then this scrip falls slightly short.
>You'll need to include a function that walks the Requestors list and
>compares $CreatorId with each Requestor in turn, returning true if it
>finds a match.
>
>
>
>On Thu, 2007-09-13 at 11:44 -0700, Gene LeDuc wrote:
> >
> > I've never used non-standard status values, but if they work just
> > like
> > "normal" status values then this should do it:
> >
> > User-defined condition:
> > { ### True if e-mail is from Requestor
> >    my $Transaction = $self->TransactionObj;
> >    my $CreatorId = $Transaction->CreatorObj->Id;
> >    my $Ticket = $self->TicketObj;
> >    my $val = $Transaction->Type eq 'Correspond'
> >           && $Ticket->Status eq "reqappr"
> >           && $Ticket->CreatorObj->Id == $CreatorId;
> >    return $val;
> > }
> >
> > Custom action (prep):
> > return 1;
> >
> > Custom action (cleanup):
> > $self->TicketObj->SetStatus("open");
> >
> > Regards,
> > Gene
> >
>--
>/Ole Craig
>Security Engineer
>Team lead, customer support
>
>ocraig at stillsecure.com
>303-381-3802 main support line
>303-381-3824 my voicemail
>303-381-3880 fax
>
>www.stillsecure.com


-- 
Gene LeDuc, GSEC
Security Analyst
San Diego State University 




More information about the rt-users mailing list