[rt-users] rt-crontool and "--action RT::Action::NotifyAsComment"

Eric MAISONOBE eric at maiso.net
Tue Jan 21 14:40:30 EST 2014


Many thanks for tour help !
Le 21 janv. 2014 20:38, "Kevin Falcone" <falcone at bestpractical.com> a écrit
:

> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20140121/3126dde9/attachment.htm>


More information about the rt-users mailing list