----- Original Message ----- > From: "Kevin Falcone" <falc...@bestpractical.com> > To: rt-users@lists.bestpractical.com > Sent: Friday, October 14, 2011 9:01:48 AM > Subject: Re: [rt-users] RT 4.0.2: Custom Condition Fails > On Thu, Oct 13, 2011 at 10:35:40PM -0400, Ryan Frantz wrote: > > Are you getting this error on startup or during the execution of the > scrip (during ticket creation).
I'm getting the error during ticket creation. > ... > > The name of the custom condition is OnAfterHoursCreate and it is > > located under > > <myRtRoot>/local/lib/RT/Condition/. What's odd is that when I > > look at the system condition > > modules, I don't see a new() method defined so I'm not sure why > > this error is occuring for > > me. For reference, this is the code for the custom condition: > > The new() method is defined in RT::Condition > > Generally, this error means some typo between: > > The filename > The package > > package RT::Condition::OnAfterHoursCreate; > The exec module > > ExecModule => 'OnAfterHoursCreate', > > Since at least 2 of those look fine, I'd double-check the filename and > permissions on the file (and on the directories leading to the file). Kevin, What's odd is that the scrip worked just fine this morning, at least once (I swear I made no changes!): Oct 14 07:20:46 rt2 RT: <rt-4.0.2-3121-1318591246-1717.1267-14-0@InforMed,LLC> #1267/20086 - Scrip 14 On After Hours Create Notify On-call Support Desk Staff (/ usr/local/rt/sbin/../lib/RT/Action/SendEmail.pm:301) However, tickets created during business hours are again throwing the error related to a missing new() method. I'll double-check the condition module's name, permissions, and directory/path permissions again, to be certain. > > Incidentally, if you're going to write a number of these, you may find > it useful to write an initialdata file: > > cat > customconditions > @ScripConditions = ( > {Name => 'On After Hours Create', > Description => 'A ticket is created after hours', > ExecModule => 'OnAfterHoursCreate', > ApplicableTransTypes => 'Create', > } > ); > ./sbin/rt-setup-database --action insert --datafile customconditions > Which is a slightly simpler way to register your custom condition. > I'll keep this handy for future reference. Thanks, Ryan > -kevin -------- RT Training Sessions (http://bestpractical.com/services/training.html) * San Francisco, CA, USA October 18 & 19, 2011 * Washington DC, USA October 31 & November 1, 2011 * Barcelona, Spain November 28 & 29, 2011