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

naoy at levillage.org naoy at levillage.org
Mon May 6 17:01:05 EDT 2002


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





More information about the rt-users mailing list