[rt-users] simple custom action question
Andy Moran
andy at wildbrain.com
Mon Nov 7 17:28:28 EST 2005
awesome. worked great. Thanks!
--Andy
Travis Campbell wrote:
> On Mon, Nov 07, 2005 at 10:40:39AM -0800, Andy Moran wrote:
>
>>Hey guys,
>>
>>I want to create a simple scrip that changes the status of a ticket from
>>New to Open when someone Takes the ticket. The Custom Condition
>>should be similar to the On Steal example from RT Essentials:
>>
>>my $trans = $self->TransactionObj;
>>return 0 unless $trans->Field eq 'Owner';
>>return 1 if $trans->OldValue == RT::Nobody()->id();
>>return 0;
>>
>>
>>So the Custom Action should just be a one-liner that changes the ticket
>>status. I was hoping to find an example of what that line would look
>>like but couldn't find one. Thanks for any help!
>
>
> This is what we use:
>
> Description: Open ticket on Take
> Condition: User Defined
> Action: User Defined
> Template: Blank
> Stage: TransactionCreate
>
> Custom Condition:
>
> if ($self->TransactionObj->Type eq 'Take' and
> $self->TicketObj->Status eq 'new')
> {
> return(1);
> } else {
> return;
> }
>
> Custom Prep:
>
> 1;
>
> Custom Cleanup:
>
> $self->TicketObj->SetStatus("open");
> 1;
>
>
> Travis
More information about the rt-users
mailing list