[rt-users] What's wrong with my scripaction

Michael Grubb mgrubb at fifthvision.net
Mon May 6 12:00:24 EDT 2002


Sorry, naoy,
I guess I didn't realize you were trying to set the status ( I can be thick 
sometimes =] )
I already have an action written to do this but in your code below replace the 
Commit method with:

sub Commit {
    my $self = shift;

    $self->TicketObj->SetStatus($self->Argument);
}


On Monday 06 May 2002 12:01 pm, naoy at levillage.org wrote:
> hello world
>
> i try to change a status to another in a scripaction but it doesn't
> work here my code:
>
> package RT::Action::ChangeStatusTo;
> require RT::Action::Generic;
> @ISA=qw(RT::Action::Generic);
>
> #Do what we need to do and send it out.
> our $VERSION = '1.0';
> #What does this type of Action does
> our $status = undef;
>
> # {{{ sub Describe
> sub Describe  {
>   my $self = shift;
>   return (ref $self . " will set the ticket to the status given in
> the argument.");
> }
> # }}}
>
>
> # {{{ sub Prepare
> sub Prepare  {
> 	my $self = shift;
> 	return 1;
> }
> # }}}
>
> sub Commit {
>     my $self = shift;
> 	$status = new RT::Queue($self->TransactionObj->CurrentUser);
> 	$status->Load($self->Argument());
> 	my ($retval, $error) = $self->TicketObj->SetStatus($status->Id());
>
> 	$RT::Logger->debug("$error\n");
> 	return $retval;
> }
>
>
> # Applicability checked in Commit.
>
> # {{{ sub IsApplicable
> sub IsApplicable  {
>   my $self = shift;
>   1;
>   return 1;
> }
> # }}}
>
> 1;
>
>
> thanks to Michael Grubb for an original Scripaction.
> thanks to he who answer me the first
>
> ---
> Ce mel a été envoyé avec Meloo http://www.meloo.com
>
>
> _______________________________________________
> rt-users mailing list
> rt-users at lists.fsck.com
> http://lists.fsck.com/mailman/listinfo/rt-users
>
> Have you read the FAQ? The RT FAQ Manager lives at http://fsck.com/rtfm





More information about the rt-users mailing list