<?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=ScripAction</id>
	<title>ScripAction - 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=ScripAction"/>
	<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ScripAction&amp;action=history"/>
	<updated>2026-08-23T02:45:31Z</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=ScripAction&amp;diff=26471&amp;oldid=prev</id>
		<title>Barton: /* Adding new actions */</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ScripAction&amp;diff=26471&amp;oldid=prev"/>
		<updated>2017-01-08T22:23:12Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Adding new actions&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 18:23, 8 January 2017&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l22&quot;&gt;Line 22:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 22:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;If you want to add additional built-in &amp;#039;&amp;#039;&amp;#039;ScripActions&amp;#039;&amp;#039;&amp;#039; you can do so by manually inserting rows into the &amp;#039;&amp;#039;&amp;#039;ScripActions&amp;#039;&amp;#039;&amp;#039; table. For example, to add a new Scrip Action for notifying [[Owner]] and [[AdminCC]]s, you can use this INSERT statement in [[MySQL]]:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;If you want to add additional built-in &amp;#039;&amp;#039;&amp;#039;ScripActions&amp;#039;&amp;#039;&amp;#039; you can do so by manually inserting rows into the &amp;#039;&amp;#039;&amp;#039;ScripActions&amp;#039;&amp;#039;&amp;#039; table. For example, to add a new Scrip Action for notifying [[Owner]] and [[AdminCC]]s, you can use this INSERT statement in [[MySQL]]:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; &lt;/del&gt;INSERT Into ScripActions(&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    &lt;/ins&gt;INSERT Into ScripActions(&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;   &lt;/del&gt;Name, Description, ExecModule, Argument, Creator, Created, LastUpdatedBy, LastUpdated&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;       &lt;/ins&gt;Name, Description, ExecModule, Argument, Creator, Created, LastUpdatedBy, LastUpdated&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; &lt;/del&gt;) VALUES (&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    &lt;/ins&gt;) VALUES (&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;   &lt;/del&gt;&#039;Notify Owner and AdminCcs&#039;, &#039;Sends mail to the Owner and AdminCcs&#039;, &#039;Notify&#039;, &#039;Owner,AdminCc&#039;, 1, NOW(), 1, NOW()&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;      &lt;/ins&gt;&#039;Notify Owner and AdminCcs&#039;, &#039;Sends mail to the Owner and AdminCcs&#039;, &#039;Notify&#039;, &#039;Owner,AdminCc&#039;, 1, NOW(), 1, NOW()&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; &lt;/del&gt;);&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    &lt;/ins&gt;);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Another nice one is to avoid sending duplicate mails to Ccs who get explicitly Cced by someone who doesn&amp;#039;t realize they&amp;#039;ll get a copy.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Another nice one is to avoid sending duplicate mails to Ccs who get explicitly Cced by someone who doesn&amp;#039;t realize they&amp;#039;ll get a copy.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; &lt;/del&gt;INSERT Into ScripActions(&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    &lt;/ins&gt;INSERT Into ScripActions(&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;   &lt;/del&gt;Name, Description, ExecModule, Argument, Creator, Created, LastUpdatedBy, LastUpdated&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;      &lt;/ins&gt;Name, Description, ExecModule, Argument, Creator, Created, LastUpdatedBy, LastUpdated&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; &lt;/del&gt;) VALUES (&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    &lt;/ins&gt;) VALUES (&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;   &lt;/del&gt;&#039;Notify Requestors, Ccs &amp;amp;amp; Other Recipients&#039;, &#039;Sends mail to the Ticket Requestor and Ccs, and explicitly listed Ccs and Bccs&#039;, &#039;Notify&#039;, &#039;Requestor,Cc,OtherRecipients&#039;, 1, NOW(), 1, NOW()&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;      &lt;/ins&gt;&#039;Notify Requestors, Ccs &amp;amp;amp; Other Recipients&#039;, &#039;Sends mail to the Ticket Requestor and Ccs, and explicitly listed Ccs and Bccs&#039;, &#039;Notify&#039;, &#039;Requestor,Cc,OtherRecipients&#039;, 1, NOW(), 1, NOW()&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; &lt;/del&gt;);&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    &lt;/ins&gt;);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The important columns are &amp;#039;&amp;#039;&amp;#039;ExecModule&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;Argument&amp;#039;&amp;#039;&amp;#039;. The &amp;#039;&amp;#039;&amp;#039;ExecModule&amp;#039;&amp;#039;&amp;#039; names the module that will perform the action. These all have the name prefix &amp;quot;RT::Action::&amp;quot;. Therefore, in the above example, the module used to perform the Scrip Action is named &amp;quot;RT::Action::Notify&amp;quot;. Possible actions include:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The important columns are &amp;#039;&amp;#039;&amp;#039;ExecModule&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;Argument&amp;#039;&amp;#039;&amp;#039;. The &amp;#039;&amp;#039;&amp;#039;ExecModule&amp;#039;&amp;#039;&amp;#039; names the module that will perform the action. These all have the name prefix &amp;quot;RT::Action::&amp;quot;. Therefore, in the above example, the module used to perform the Scrip Action is named &amp;quot;RT::Action::Notify&amp;quot;. Possible actions include:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key bestpractical_mediawiki1459887241:diff:1.41:old-3378:rev-26471:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Barton</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ScripAction&amp;diff=3378&amp;oldid=prev</id>
		<title>Admin: 4 revisions imported</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ScripAction&amp;diff=3378&amp;oldid=prev"/>
		<updated>2016-04-06T20:37:37Z</updated>

		<summary type="html">&lt;p&gt;4 revisions imported&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;ScripAction&amp;#039;&amp;#039;&amp;#039; - is Perl code formed as module or filled in [[CustomActionPreparationCode]] and [[CustomActionCleanupCode]] [[Scrip]] fields.&lt;br /&gt;
&lt;br /&gt;
This code applied after [[Condition]] check when [[Transaction]] is applicable.&lt;br /&gt;
&lt;br /&gt;
A &amp;#039;&amp;#039;&amp;#039;ScripAction&amp;#039;&amp;#039;&amp;#039; can access and change the current instance of the following objects:&lt;br /&gt;
&lt;br /&gt;
* [[Scrip]]&lt;br /&gt;
* [[Ticket]]&lt;br /&gt;
* [[Transaction]]&lt;br /&gt;
* [[Template]]&lt;br /&gt;
&lt;br /&gt;
Note that Per-Transaction custom fields values are not available to ScripActions, (RT sets these after the Scrip has been executed) unless you change the Global Scrip Stage from Normal to Batch in the Applies to Page for your Scrip (as described in [[TransactionBatchStage]] .)  If your Scrip is set to Batch then it will be run after all the Transactions have been created.&lt;br /&gt;
&lt;br /&gt;
Some of the built-in actions are:&lt;br /&gt;
&lt;br /&gt;
* Autoreply - emails the requestor&lt;br /&gt;
* Notify and NotifyAsComment - emails the correspondance to ticket recipients&lt;br /&gt;
* CreateTickets - creates one or more tickets according to the specified template&lt;br /&gt;
&lt;br /&gt;
== Adding new actions ==&lt;br /&gt;
&lt;br /&gt;
If you want to add additional built-in &amp;#039;&amp;#039;&amp;#039;ScripActions&amp;#039;&amp;#039;&amp;#039; you can do so by manually inserting rows into the &amp;#039;&amp;#039;&amp;#039;ScripActions&amp;#039;&amp;#039;&amp;#039; table. For example, to add a new Scrip Action for notifying [[Owner]] and [[AdminCC]]s, you can use this INSERT statement in [[MySQL]]:&lt;br /&gt;
&lt;br /&gt;
 INSERT Into ScripActions(&lt;br /&gt;
   Name, Description, ExecModule, Argument, Creator, Created, LastUpdatedBy, LastUpdated&lt;br /&gt;
 ) VALUES (&lt;br /&gt;
   &amp;#039;Notify Owner and AdminCcs&amp;#039;, &amp;#039;Sends mail to the Owner and AdminCcs&amp;#039;, &amp;#039;Notify&amp;#039;, &amp;#039;Owner,AdminCc&amp;#039;, 1, NOW(), 1, NOW()&lt;br /&gt;
 );&lt;br /&gt;
&lt;br /&gt;
Another nice one is to avoid sending duplicate mails to Ccs who get explicitly Cced by someone who doesn&amp;#039;t realize they&amp;#039;ll get a copy.&lt;br /&gt;
&lt;br /&gt;
 INSERT Into ScripActions(&lt;br /&gt;
   Name, Description, ExecModule, Argument, Creator, Created, LastUpdatedBy, LastUpdated&lt;br /&gt;
 ) VALUES (&lt;br /&gt;
   &amp;#039;Notify Requestors, Ccs &amp;amp;amp; Other Recipients&amp;#039;, &amp;#039;Sends mail to the Ticket Requestor and Ccs, and explicitly listed Ccs and Bccs&amp;#039;, &amp;#039;Notify&amp;#039;, &amp;#039;Requestor,Cc,OtherRecipients&amp;#039;, 1, NOW(), 1, NOW()&lt;br /&gt;
 );&lt;br /&gt;
&lt;br /&gt;
The important columns are &amp;#039;&amp;#039;&amp;#039;ExecModule&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;Argument&amp;#039;&amp;#039;&amp;#039;. The &amp;#039;&amp;#039;&amp;#039;ExecModule&amp;#039;&amp;#039;&amp;#039; names the module that will perform the action. These all have the name prefix &amp;quot;RT::Action::&amp;quot;. Therefore, in the above example, the module used to perform the Scrip Action is named &amp;quot;RT::Action::Notify&amp;quot;. Possible actions include:&lt;br /&gt;
&lt;br /&gt;
* AutoOpen - set the ticket status to open&lt;br /&gt;
* Autoreply - send an auto-reply to the requestor&lt;br /&gt;
* CreateTickets - create a ticket or tickets based upon the template&lt;br /&gt;
* NotifyAsComment - send a comment to the recipients in &amp;#039;&amp;#039;&amp;#039;Argument&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Notify - send a comment to the recipients in &amp;#039;&amp;#039;&amp;#039;Argument&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* UserDefined - execute the custom action code&lt;br /&gt;
&lt;br /&gt;
Full list of available modules for actions you can find in the &amp;lt;code&amp;gt;lib/RT/Action/&amp;lt;/code&amp;gt; dir. Each module has inlined documentation, you can read it with [[perldoc]] utility, for example [=perldoc lib/RT/Action/[[AutoOpen]].pm].&lt;br /&gt;
&lt;br /&gt;
Values of the &amp;#039;&amp;#039;&amp;#039;Argument&amp;#039;&amp;#039;&amp;#039; field are different for different modules. Many modules have no description of the format that must be used, in such a case ask on the [[MailingLists]] and then when you&amp;#039;ll figure that out, please, send a patch to the rt developers team.&lt;br /&gt;
&lt;br /&gt;
See also [[SendEmailAction]] (todo: integrate)&lt;br /&gt;
&lt;br /&gt;
== Managing notification actions ==&lt;br /&gt;
&lt;br /&gt;
A common user problem is that RT sends two (or more) notifications if a user is in two recipients lists at the same time, for example in both the [[CC]]s and [[Requestor]]s lists. This happens when you have &amp;#039;&amp;#039;&amp;#039;two&amp;#039;&amp;#039;&amp;#039; scrips one with Action &amp;#039;Notify Cc&amp;#039; and another with &amp;#039;notify requestors&amp;#039;. RT by default has several complex combinations, for example &amp;#039;Notify Requestors, Ccs and AdminCcs&amp;#039;. When there is no required combination of recipients you can create your own.&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Argument&amp;#039;&amp;#039;&amp;#039; for Autoreply, NotifyAsComment, and Notify should be the name of a recipient. The following recipients are possible.&lt;br /&gt;
&lt;br /&gt;
* [[Requestor]] - the person or persons making the request&lt;br /&gt;
* [[Owner]] - the owner of the request&lt;br /&gt;
* [[?CC|Cc]] - all the Ccs set on the ticket&lt;br /&gt;
* [[?AdminCC|AdminCc]] - all the AdminCcs set on the ticket&lt;br /&gt;
* All - this is the same as &amp;quot;[=Requestor,Owner,Cc,[[AdminCc]]]&amp;quot;&lt;br /&gt;
* OtherRecipients - the Ccs and Bccs set on the transaction&lt;br /&gt;
&lt;br /&gt;
You can also use any combination of the above by separating multiple recipients by a comma without whitespace. For example, &amp;quot;&amp;lt;code&amp;gt;Requestor,Owner&amp;lt;/code&amp;gt;&amp;quot; would send to requestors and owners. See the example of INSERT query above.&lt;br /&gt;
&lt;br /&gt;
See also [[SendEmailAction]] (todo: integrate)&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
[[Contributions]], [[WriteCustomAction]]&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ScripAction&amp;diff=3376&amp;oldid=prev</id>
		<title>178.79.131.132 at 13:59, 2 June 2012</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ScripAction&amp;diff=3376&amp;oldid=prev"/>
		<updated>2012-06-02T13:59:51Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;ScripAction&amp;#039;&amp;#039;&amp;#039; - is Perl code formed as module or filled in [[CustomActionPreparationCode]] and [[CustomActionCleanupCode]] [[Scrip]] fields.&lt;br /&gt;
&lt;br /&gt;
This code applied after [[Condition]] check when [[Transaction]] is applicable.&lt;br /&gt;
&lt;br /&gt;
A &amp;#039;&amp;#039;&amp;#039;ScripAction&amp;#039;&amp;#039;&amp;#039; can access and change the current instance of the following objects:&lt;br /&gt;
&lt;br /&gt;
* [[Scrip]]&lt;br /&gt;
* [[Ticket]]&lt;br /&gt;
* [[Transaction]]&lt;br /&gt;
* [[Template]]&lt;br /&gt;
&lt;br /&gt;
Note that Per-Transaction custom fields values are not available to ScripActions. (RT sets these after the Scrip has been executed.)&lt;br /&gt;
&lt;br /&gt;
Some of the built-in actions are:&lt;br /&gt;
&lt;br /&gt;
* Autoreply - emails the requestor&lt;br /&gt;
* Notify and NotifyAsComment - emails the correspondance to ticket recipients&lt;br /&gt;
* CreateTickets - creates one or more tickets according to the specified template&lt;br /&gt;
&lt;br /&gt;
== Adding new actions ==&lt;br /&gt;
&lt;br /&gt;
If you want to add additional built-in &amp;#039;&amp;#039;&amp;#039;ScripActions&amp;#039;&amp;#039;&amp;#039; you can do so by manually inserting rows into the &amp;#039;&amp;#039;&amp;#039;ScripActions&amp;#039;&amp;#039;&amp;#039; table. For example, to add a new Scrip Action for notifying [[Owner]] and [[AdminCC]]s, you can use this INSERT statement in [[MySQL]]:&lt;br /&gt;
&lt;br /&gt;
 INSERT Into ScripActions(&lt;br /&gt;
   Name, Description, ExecModule, Argument, Creator, Created, LastUpdatedBy, LastUpdated&lt;br /&gt;
 ) VALUES (&lt;br /&gt;
   &amp;#039;Notify Owner and AdminCcs&amp;#039;, &amp;#039;Sends mail to the Owner and AdminCcs&amp;#039;, &amp;#039;Notify&amp;#039;, &amp;#039;Owner,AdminCc&amp;#039;, 1, NOW(), 1, NOW()&lt;br /&gt;
 );&lt;br /&gt;
&lt;br /&gt;
Another nice one is to avoid sending duplicate mails to Ccs who get explicitly Cced by someone who doesn&amp;#039;t realize they&amp;#039;ll get a copy.&lt;br /&gt;
&lt;br /&gt;
 INSERT Into ScripActions(&lt;br /&gt;
   Name, Description, ExecModule, Argument, Creator, Created, LastUpdatedBy, LastUpdated&lt;br /&gt;
 ) VALUES (&lt;br /&gt;
   &amp;#039;Notify Requestors, Ccs &amp;amp;amp; Other Recipients&amp;#039;, &amp;#039;Sends mail to the Ticket Requestor and Ccs, and explicitly listed Ccs and Bccs&amp;#039;, &amp;#039;Notify&amp;#039;, &amp;#039;Requestor,Cc,OtherRecipients&amp;#039;, 1, NOW(), 1, NOW()&lt;br /&gt;
 );&lt;br /&gt;
&lt;br /&gt;
The important columns are &amp;#039;&amp;#039;&amp;#039;ExecModule&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;Argument&amp;#039;&amp;#039;&amp;#039;. The &amp;#039;&amp;#039;&amp;#039;ExecModule&amp;#039;&amp;#039;&amp;#039; names the module that will perform the action. These all have the name prefix &amp;quot;RT::Action::&amp;quot;. Therefore, in the above example, the module used to perform the Scrip Action is named &amp;quot;RT::Action::Notify&amp;quot;. Possible actions include:&lt;br /&gt;
&lt;br /&gt;
* AutoOpen - set the ticket status to open&lt;br /&gt;
* Autoreply - send an auto-reply to the requestor&lt;br /&gt;
* CreateTickets - create a ticket or tickets based upon the template&lt;br /&gt;
* NotifyAsComment - send a comment to the recipients in &amp;#039;&amp;#039;&amp;#039;Argument&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Notify - send a comment to the recipients in &amp;#039;&amp;#039;&amp;#039;Argument&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* UserDefined - execute the custom action code&lt;br /&gt;
&lt;br /&gt;
Full list of available modules for actions you can find in the &amp;lt;code&amp;gt;lib/RT/Action/&amp;lt;/code&amp;gt; dir. Each module has inlined documentation, you can read it with [[perldoc]] utility, for example [=perldoc lib/RT/Action/[[AutoOpen]].pm].&lt;br /&gt;
&lt;br /&gt;
Values of the &amp;#039;&amp;#039;&amp;#039;Argument&amp;#039;&amp;#039;&amp;#039; field are different for different modules. Many modules have no description of the format that must be used, in such a case ask on the [[MailingLists]] and then when you&amp;#039;ll figure that out, please, send a patch to the rt developers team.&lt;br /&gt;
&lt;br /&gt;
See also [[SendEmailAction]] (todo: integrate)&lt;br /&gt;
&lt;br /&gt;
== Managing notification actions ==&lt;br /&gt;
&lt;br /&gt;
A common user problem is that RT sends two (or more) notifications if a user is in two recipients lists at the same time, for example in both the [[CC]]s and [[Requestor]]s lists. This happens when you have &amp;#039;&amp;#039;&amp;#039;two&amp;#039;&amp;#039;&amp;#039; scrips one with Action &amp;#039;Notify Cc&amp;#039; and another with &amp;#039;notify requestors&amp;#039;. RT by default has several complex combinations, for example &amp;#039;Notify Requestors, Ccs and AdminCcs&amp;#039;. When there is no required combination of recipients you can create your own.&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Argument&amp;#039;&amp;#039;&amp;#039; for Autoreply, NotifyAsComment, and Notify should be the name of a recipient. The following recipients are possible.&lt;br /&gt;
&lt;br /&gt;
* [[Requestor]] - the person or persons making the request&lt;br /&gt;
* [[Owner]] - the owner of the request&lt;br /&gt;
* [[?CC|Cc]] - all the Ccs set on the ticket&lt;br /&gt;
* [[?AdminCC|AdminCc]] - all the AdminCcs set on the ticket&lt;br /&gt;
* All - this is the same as &amp;quot;[=Requestor,Owner,Cc,[[AdminCc]]]&amp;quot;&lt;br /&gt;
* OtherRecipients - the Ccs and Bccs set on the transaction&lt;br /&gt;
&lt;br /&gt;
You can also use any combination of the above by separating multiple recipients by a comma without whitespace. For example, &amp;quot;&amp;lt;code&amp;gt;Requestor,Owner&amp;lt;/code&amp;gt;&amp;quot; would send to requestors and owners. See the example of INSERT query above.&lt;br /&gt;
&lt;br /&gt;
See also [[SendEmailAction]] (todo: integrate)&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
[[Contributions]], [[WriteCustomAction]]&lt;/div&gt;</summary>
		<author><name>178.79.131.132</name></author>
	</entry>
</feed>