What's wrong with my scripaction

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

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@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@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