#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
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:
#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