[rt-users] How to create a scrip Condition for OnAddRequestor

Emmanuel Lacour elacour at easter-eggs.com
Fri Jan 17 10:51:35 EST 2014


On Fri, Jan 17, 2014 at 07:10:43AM -0800, rwzoerner wrote:
>    Emmanuel,
> 
>    Thanks for great input but those things we are already doing.
>    The key, though, is that when a new requester IS added, for any reason,
>    they need to receive an email (the Autoreply template, actually) letting
>    them know. That's what I need the condition for - how to trap the addition
>    of a new Requester so I can then Notify Requesters in a scrip. The normal
>    scrip only fires On Create - I need one to fire On Add Requester.
> 

For your UserDefined condition, adding a Requestor is matched via:

if ( $self->TransactionObj->Type eq 'AddWatcher' &&
    $self->TransactionObj->Field eq 'Requestor' ) {
    ...


you may check also that we are adding a requestor and not changing an
existing one:

if ( ! $self->TransactionObj->OldValue ) {


The new requestor id will be in $self->TransactionObj->NewValue, you have to  load it as a RT::User to get the EmailAddress and use it in your template.


-- 
Easter-eggs                              Spécialiste GNU/Linux
44-46 rue de l'Ouest  -  75014 Paris  -  France -  Métro Gaité
Phone: +33 (0) 1 43 35 00 37    -   Fax: +33 (0) 1 43 35 00 76
mailto:elacour at easter-eggs.com  -   http://www.easter-eggs.com



More information about the rt-users mailing list