<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://rt-wiki.bestpractical.com/index.php?action=history&amp;feed=atom&amp;title=TimedNotifications</id>
	<title>TimedNotifications - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://rt-wiki.bestpractical.com/index.php?action=history&amp;feed=atom&amp;title=TimedNotifications"/>
	<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=TimedNotifications&amp;action=history"/>
	<updated>2026-08-23T23:58:38Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.1</generator>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=TimedNotifications&amp;diff=3884&amp;oldid=prev</id>
		<title>Admin: 2 revisions imported</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=TimedNotifications&amp;diff=3884&amp;oldid=prev"/>
		<updated>2016-04-06T20:39:29Z</updated>

		<summary type="html">&lt;p&gt;2 revisions imported&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Sending notification emails with rt-crontool&lt;br /&gt;
&lt;br /&gt;
It is now possible to add an email comment or correspondence to a ticket (or selection of tickets) using an external command-line tool. Together with rt-crontool, the administrator now has the ability to schedule timed notifications for tickets that meet certain criteria.&lt;br /&gt;
&lt;br /&gt;
The key modules for this are RT::Search::[[FromSQL]] and RT::Action::[[RecordComment]] (or RT::Action::[[RecordCorrespondence]], although you may not want to send &amp;quot;unowned after 2 days&amp;quot; escalation alerts to the customer who opened the ticket.) The steps are thus:&lt;br /&gt;
&lt;br /&gt;
* Create a template. It is probably easiest to create a global template; this can be done by clicking on Configuration -&amp;amp;gt; Global -&amp;amp;gt; Templates -&amp;amp;gt; New Template. If you wish to have different messages for your different ticket queues, you may also create queue-specific templates. Name the template something memorable, such as &amp;#039;Unowned tickets&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The template content might look like this:&lt;br /&gt;
&lt;br /&gt;
  Subject: {$Ticket-&amp;amp;gt;id} unowned after 48 hours!&lt;br /&gt;
  RT-Send-Cc: management@company.com, projectlead@company.com&lt;br /&gt;
 &lt;br /&gt;
 The ticket {$Ticket-&amp;amp;gt;id} has been unowned for 2 days now.  Get busy.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
Key to this template is the RT-Send-Cc: (or RT-Send-Bcc:) field, in which you should put the email addresses of those who should get this escalation email. Any internal watchers of the ticket would also get this email.&lt;br /&gt;
&lt;br /&gt;
* Create a TicketSQL query. The easiest way to do this is to build the query in the web Query Builder, and then click on &amp;quot;Advanced&amp;quot; to see the TicketSQL. Make a note of this query string; you will need it for running rt-crontool. (Do NOT copy the query strings directly in the examples below; any system-specific user [[IDs]] could well be different, so be sure to use the one that the Query Builder generates for you.)&lt;br /&gt;
&lt;br /&gt;
* Set up a cron job using rt-crontool. In the above example we might have the following in crontab:&lt;br /&gt;
&lt;br /&gt;
 0 3 * * * /opt/rt3/bin/rt-crontool --search RT::Search::FromSQL \&lt;br /&gt;
  --search-arg &amp;quot;Owner = &amp;#039;10&amp;#039;  AND Created &amp;amp;lt; &amp;#039;2 days ago&amp;#039; AND Created &amp;amp;gt; &amp;#039;3 days ago&amp;#039;&amp;quot;  \&lt;br /&gt;
  --action RT::Action::RecordComment --template &amp;#039;Unowned tickets&amp;#039;&lt;br /&gt;
&lt;br /&gt;
* Another example, for an unresolved ticket that has not been updated in 7 days, might look like this:&lt;br /&gt;
&lt;br /&gt;
 0 3 * * * /opt/rt3/bin/rt-crontool --search RT::Search::FromSQL \&lt;br /&gt;
 --search-arg &amp;quot;LastUpdated &amp;amp;lt; &amp;#039;7 days ago&amp;#039;  AND Status != &amp;#039;resolved&amp;#039; AND Status != &amp;#039;rejected&amp;#039;&amp;quot; \&lt;br /&gt;
 --action RT::Action::RecordComment --template &amp;#039;Ignored tickets&amp;#039;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
If you wish the generated email to also go to the customer, simply use RT::Action::[[RecordCorrespondence]] instead of RT::Action::[[RecordComment]].&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
</feed>