[rt-users] weirdness in scrip

jul jul-rt at julbox.net
Fri Mar 13 14:58:15 EDT 2009


Hi,

How do I return a Result when refusing a transaction so that user know
what they did wrong (in my case, I just check that a customField is not
null is selected Queue)

Condition : OnResolve
Action: User Defined
Stage:Transaction Create.


# Only do it for certain queues.
my @queues = (5,6,7,8,9,10);
my $queue_id = $self->TicketObj->Queue;
my $val = grep { /^${queue_id}$/ } @queues;
$RT::Logger->error("been here");

if ($val) {
     my $CF = RT::CustomField->new( $RT::SystemUser );
my $res=$self->TicketObj->FirstCustomFieldValue('Responsabilite');
     $RT::Logger->error("valjul::<" . $res . ">");
     $RT::Logger->error("ok::" . ($res ? 1 : 0) );
$self->TicketObj->SetStatus("open");
  return $res ? 1 : undef;
}

return 1;

It works well

What is weired, is that clean and prepare action are always evaluated,
never custom condition. So I play with it.

My question is : is there a way to inform the user that he must fill the
custom field in the result area ?



-- 
Julien Tayon // digital craftsman // making things simpler (when possible)

Most people need some of their problems to help take their mind off
some of the others.





More information about the rt-users mailing list