[rt-users] script : custom action by ticket creation or modification

Kevin Falcone falcone at bestpractical.com
Tue Jun 29 11:01:58 EDT 2010


On Tue, Jun 29, 2010 at 10:09:19AM +0200, Horst Kriegers wrote:
>    the following scrip works only "On transaction" but not wen a new ticket is created.
>    What is wrong ?

Your condition says "only work when this is a custom field change", it
doesn't consider Create types at all.

-kevin

>    - Condition : User Defined
>    - Custom condition :
> 
>    my $trans = $self->TransactionObj;
>    my $ticket = $self->TicketObj;
> 
>    if ($trans->Type eq 'CustomField') {
>      my $cf = new RT::CustomField($RT::SystemUser);
>      $cf->LoadByName(Queue => $ticket->QueueObj->id, Name => "Qualification securite");
>      return 0 unless $cf->id;
> 
>      if ($trans->Field == $cf->id && $trans->NewValue eq "Oui") {
>        return 1;
>      }
> 
>    }
>    return 0;
-------------- 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/20100629/59cb91ea/attachment.sig>


More information about the rt-users mailing list