[rt-users] Initiate Template via custom scrip action

Raed El-Hames rfh at vialtus.com
Tue Apr 20 12:43:21 EDT 2010


Kristian;

What happens if you move your action code to the condition and then make 
you rAction : Notify Requestors with the Template you need ; ie your 
condition will be something like:

Custom Condition:

my $Transaction = $self->TransactionObj;
my $CreatorId = $Transaction->CreatorObj->Id;

if ( $self->TransactionObj->Type eq "Create" &&
!$self->TicketObj->QueueObj->IsAdminCc($CreatorId) ){
  
    my $Ticket = $self->TicketObj;
    my $newqueue = "23";

    $Ticket->SetQueue($newqueue);
    return 1;
}
return undef;


I've  not done this ; but I think will work for what you want.

Roy

Kristian Davies wrote:
> I've created a scrip:
>
> Condition: User Defined
> Action: User Defined
> Template: Global Template: Blank
> Stage: TransactionCreate
>
> Custom Condition:
>
> my $Transaction = $self->TransactionObj;
> my $CreatorId = $Transaction->CreatorObj->Id;
>
> if ( $self->TransactionObj->Type eq "Create" &&
> !$self->TicketObj->QueueObj->IsAdminCc($CreatorId) ){
> return 1;
> }
>
> Custom action prep code:
>
> my $Ticket = $self->TicketObj;
> my $newqueue = "23";
>
> $Ticket->SetQueue($newqueue);
>
> Custom action cleanup code:
>
> return 1;
>
>
> Basically I just need to fire off a template to those requestors who's
> tickets are moved via this scrip.
>
>
> Cheers,
> Kristian
>
> Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
> Buy a copy at http://rtbook.bestpractical.com
>   



More information about the rt-users mailing list