我可以在脚本中以RT4方式取消票证吗?

时间:2015-09-17 20:44:34

标签: perl

我尝试创建一个脚本,根据移动的队列更改所有者。但不幸的是,我总是收到此错误消息:

You can only reassign tickets that you own or that are unowned 

我首先尝试删除所有者,并将其设置为nobody,但这当然也不起作用:

condition: on queue change
action: user defined
template: blank
stage: transaction create

____preperation code:
my ($status, $msg) = $self->TicketObj->SetOwner( $RT::Nobody->id ); 
unless( $status ) {
      $RT::Logger->warning( "Preperation: Impossible to assign the ticket to Nobody: $msg" );
return undef;
} 0;

___cleanup code:
my %owners = (
'foo' => 'userbar',
'bla' => 'userfoo',
);


my $QueueName = $self->TicketObj->QueueObj->Name; 
return 1 unless defined($owners{$QueueName}); 

my $MyUser = $owners{$QueueName}; 
$RT::Logger->info("Auto assigning ticket #". $self->TicketObj->id ." to user $MyUser" ); 
my ($status, $msg) = $self->TicketObj->SetOwner( $MyUser ); 
unless( $status ) {
      $RT::Logger->warning( "Impossible to assign the ticket to $MyUser: $msg" );
return undef;
} 1;

是否有可能使用脚本删除故障单的所有者?

1 个答案:

答案 0 :(得分:0)

在这里找到答案:http://lists.bestpractical.com/pipermail/rt-users/2009-September/061521.html

您可以通过以下方式强制执行故障单的所有者:

$ticket->SetOwner(10, 'Force');