How to periodically mail out last ticket correspondence

Hello,

I would like to periodically send out last recorded correspondence
for all stalled tickets. Possibly in some clean way. I know how to
use crontool, locate interesting tickets, get last transaction, even
load a template and record a message in ticket history … but still
can’t find a way to send out a ticket with SendMail or Notify. I can
use the ‘dirty’ way and create mail message and send it on my own
(like rt-remind does), but there should be some correct way.

I can also setup a nice scrip action in RT which works just fine,
but there is no way to trigger it from cron, or is it?

Any help appreciated

Tomáš Valenta

I figured it out with rt-crontool on RT 3.6.3:

rt-crontool --search RT::Search::FromSQL --search-arg “(Status=‘stalled’)” --action RT::Action::Notify --action-arg Requestor --template-id 15 --transaction last --transaction-type Correspond

The real trouble was with rights in RT - the user in rt which is linked to system user running the cron job must have the rights to read templates, tickets and all correpondence of ticket. If he has not, no error message is given and the action will just not occur. I had to do some serious digging into the code to figure out what’s wrong. Hope this will help other users to save time.

Tomáš Valenta