Debugging a Create Ticket scrip

G’day,

I’m trying to debug a scrip that is supposed to create a ticket
in a different queue, but doesn’t.

The rt.log gives me this:

[Wed Dec 14 04:43:03 2005] [warning]: DBD::mysql::st execute failed: Column 'TimeTaken' cannot be null at /usr/share/perl5/DBIx/SearchBuilder/Handle.pm line 480.
 (/usr/share/request-tracker3.4/lib/RT.pm:277)
[Wed Dec 14 04:43:03 2005] [warning]: RT::Handle=HASH(0x87702bc) couldn't execute the query 'INSERT INTO Transactions (OldValue, NewReference, OldReference, NewValue, TimeTaken, Creator, ObjectId, Type, Field, ReferenceType, Created, Data, ObjectType) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' at /usr/share/perl5/DBIx/SearchBuilder/Handle.pm line 494.
 (/usr/share/request-tracker3.4/lib/RT.pm:277)
[Wed Dec 14 04:43:03 2005] [warning]: Internal Error: Couldn't execute the query 'INSERT INTO Transactions (OldValue, NewReference, OldReference, NewValue, TimeTaken, Creator, ObjectId, Type, Field, ReferenceType, Created, Data, ObjectType) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'Column 'TimeTaken' cannot be null (/usr/share/request-tracker3.4/lib/RT/Record.pm:1393)

Is this is any way related or relevant?

How can I get relevant debugging information about why the scrip is failing?

My custom condition looks like this:

if (
	($self->TransactionObj->Type eq "CustomField") and
	(
		($self->TransactionObj->NewValue =~ /partial delivery/i)
	||
		($self->TransactionObj->NewValue =~ /received in full/i)
	)    
)
  return(1);
}
else
{
  return(undef);
}

And my template looks like this:

===Create-Ticket: inventory ticket
Queue: Inventory
RefersTo: { $Tickets{'TOP'}->Id() }
Content: There has been a partial or full delivery from a purchase order you requested. Please fill out the inventory now before you forget.
ENDOFCONTENT

I’ve tried putting RT::Logger->error() statements in the scrip cleanup code but nothing comes
out in the logs. I’m stumped!

Ideas much appreciated.

Thanks,

Jens

My custom condition looks like this:

if (
($self->TransactionObj->Type eq “CustomField”) and
(
($self->TransactionObj->NewValue =~ /partial delivery/i)
||
($self->TransactionObj->NewValue =~ /received in full/i)
)
)
return(1);
}
else
{
return(undef);
}

OK, I’ve fixed the syntax error in the above to if(…){return}else{…}
as it should be, but that makes no difference.

Jens