On Thu, Jan 16, 2014 at 06:46:06PM +0100, Eric Maisonobe wrote: > Hello, > I try to use the following cron task : > /opt/rt4/bin/rt-crontool \ > > --search RT::Search::FromSQL \ > --search-arg "Created < '1 day ago' AND (Status = 'new') " \ > --action RT::Action::NotifyAsComment \ > --action-arg 'OtherRecipients' > --template 'my_nice_template' > > but nothing is done (no comment and no notification), because RT complains > : > > [critical]: Can't call method "CreatorObj" on an undefined value at > /opt/rt4/bin/../lib/RT/Action/Notify.pm line 134. > (/opt/rt4/bin/../lib/RT.pm:400) > > I look at "/opt/rt4/bin/../lib/RT/Action/Notify.pm line 134" and i see : > > my $creatorObj = $self->TransactionObj->CreatorObj; > > So, does anybody knows : > -> how to use rt-crontool with "--action RT::Action::NotifyAsComment", > -> or how to specify the default RT system user in the Notify.pm script > something like : > > eval( my $creatorObj = $self->TransactionObj->CreatorObj) || my > $creatorObj = > <RT_DEFAULT_USER_OBJ>;
You want the --transaction argument if you're going to use a Notify action: http://bestpractical.com/docs/rt/latest/rt-crontool.html You want first or last, not all. You may find the notification example of the reminders documentation interesting http://bestpractical.com/docs/rt/latest/reminders.html#Email-Reminders -kevin
pgp47QZVp8qAT.pgp
Description: PGP signature