[rt-users] simple custom action question

Travis Campbell travis.campbell at amd.com
Mon Nov 7 16:57:16 EST 2005


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
-- 
 Travis Campbell  -  Unix Systems Administrator =    travis at mpdtxmail.amd.com
    5900 E. Ben White Blvd, Austin, TX 78741    =     travis.campbell at amd.com
    TEL: (512) 602-1888  PAG: (512) 604-0341    = webmaster at mpdtxmail.amd.com  
=============================================================================
      "Does anything work as expected?"  Yes.  An axe through the CPU.




More information about the rt-users mailing list