[rt-users] RT tool & RecordTransaction => 0

Bart bart at pleh.info
Thu Dec 8 10:22:02 EST 2011


So this if statement would be more accurate: (to have the ability to have a
little more specific error log message)

        if ($tstatus eq 'new') {
                my ($status, $msg) =
$self->TicketObj->AddCustomFieldValue(Field => 'aantal_minuten_new', Value
=> $self->TicketObj->FirstCustomFieldValue( 'aantal_minuten_new' ) + 5,
RecordTransaction => 0 );
                unless ( $status ) {
                        $RT::Logger->error("Coudln't change Custom Field:
". $msg);
                        return 0;
                }
        }

(test run seems to work this way)

-- Bart


Op 8 december 2011 15:44 schreef Ruslan Zakirov <ruz at bestpractical.com> het
volgende:

> On Thu, Dec 8, 2011 at 17:00, Bart <bart at pleh.info> wrote:
> > I think I've finished it, only have some issues with the
> $RT::Logger->error
> > thing. The scrip won't launch when I have that part enabled, when
> disabled
> > it runs just fine O_o
>
> $val is inside if {} block and lexically scoped, so it's not available
> outside.
>
> Use my ($val, $msg); if { ($val, $msg) = ... }
>
> --
> Best regards, Ruslan.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20111208/c2764e05/attachment.htm>


More information about the rt-users mailing list