[rt-users] Forcing Status Changes

Mario Gomide mario.gomide at agricultura.gov.br
Wed Jul 25 16:47:07 EDT 2007


Hi Kenn, hi Gene!

I had some trouble with the logging part, but I fixed it. Then I had 
this problem:
[error]: Scrip Prepare XX died. - Undefined subroutine 
&Scalar::Util::weaken called at /usr/local/rt3/lib/RT/Action/Generic.pm 
line 107.

This was also fixed after updating Scalar::Util via CPAN with the command:
#cpan -fi Scalar::Util
but still got nothing... so I rebooted and it began to work, and now my 
scrip is running and logging.

Apparently, the scrip is working fine, and now back to my original 
problem: When a ticket with status "A" cannot change to status "B", the 
result text shows that this status change occurred (Status changed from 
A to B), even though it in fact didn't ocurr (the status is unchanged).
How can I, in this case, show an error message like "ERROR: Status 
cannot be changed from A to B! Status remains A." on the results part 
after modifying a ticket?
I've tried to set in the scrip, inside the "if" statement:
return $self->loc("TEXT TELLING THE USER HE CANT CHANGE FROM STATUS A TO 
B");
but my text doesn't appear... since I'm sort of new to perl and 
customizing RT, this was like a blind guess...

Any ideas?
Anyway, thanks so much for your help so far!

Mario


Kenneth Crocker escreveu:
> Mario,
>
>
>     Gene is right (he helped me a bunch when I created several scrips 
> that change ticket status for a workflow design)). The entries to your 
> log will help a great deal. I had several scrips that made several 
> changes (one at a time) and when it ran into an error, the status did 
> not get changed. I'd take a look at your log and see what is 
> happening. That will help in debugging your code.
>
>
> Kenn
> LBNL



More information about the rt-users mailing list