<?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=ScripActions_for_splitting_AdminCC_into_QueueAdminCc_and_TicketAdminCc</id>
	<title>ScripActions for splitting AdminCC into QueueAdminCc and TicketAdminCc - 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=ScripActions_for_splitting_AdminCC_into_QueueAdminCc_and_TicketAdminCc"/>
	<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ScripActions_for_splitting_AdminCC_into_QueueAdminCc_and_TicketAdminCc&amp;action=history"/>
	<updated>2026-08-23T04:11:52Z</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=ScripActions_for_splitting_AdminCC_into_QueueAdminCc_and_TicketAdminCc&amp;diff=3382&amp;oldid=prev</id>
		<title>Admin: 3 revisions imported</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ScripActions_for_splitting_AdminCC_into_QueueAdminCc_and_TicketAdminCc&amp;diff=3382&amp;oldid=prev"/>
		<updated>2016-04-06T20:37:37Z</updated>

		<summary type="html">&lt;p&gt;3 revisions imported&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;I wanted to use the Queue AdminCcs watchers for notifications of new tickets in their queues.&lt;br /&gt;
&lt;br /&gt;
By convention QueueAdminCcs are also sent email about each transaction for a ticket.  I only wanted TicketAdminCcs notified about ticket transactions.&lt;br /&gt;
&lt;br /&gt;
Scrip action Notify.pm is used to send emails to the various groups of people.  I tried using the [http://requesttracker.8502.n7.nabble.com/Script-to-Squelch-Queue-AdminCc-s-on-Ticket-Creation-td53400.html Squelch email approach] but reached the same conclusion as in the email thread, that extending Notify.pm was a better solution.&lt;br /&gt;
&lt;br /&gt;
==Local overlay for Notify.pm==&lt;br /&gt;
&lt;br /&gt;
I copied lib/RT/Action/Notify.pm to local/lib/RT/Action/Notify.pm&lt;br /&gt;
&lt;br /&gt;
and applied the following patch:&lt;br /&gt;
 --- /usr/share/request-tracker4/lib/RT/Action/Notify.pm	2013-06-02 15:24:41.000000000 +0100&lt;br /&gt;
 +++ Notify.pm	2013-08-28 10:30:50.156399864 +0100&lt;br /&gt;
 @@ -74,6 +74,8 @@&lt;br /&gt;
  Sets the recipients of this meesage to Owner, Requestor, AdminCc, Cc or All. &lt;br /&gt;
  Explicitly B&amp;lt;does not&amp;gt; notify the creator of the transaction by default&lt;br /&gt;
  &lt;br /&gt;
 +Added TicketAdminCc and QueueAdminCc as recipent options.&lt;br /&gt;
 +&lt;br /&gt;
  =cut&lt;br /&gt;
  &lt;br /&gt;
  sub SetRecipients {&lt;br /&gt;
 @@ -86,6 +88,7 @@&lt;br /&gt;
  &lt;br /&gt;
      my ( @To, @PseudoTo, @Cc, @Bcc );&lt;br /&gt;
  &lt;br /&gt;
 +    RT::Logger-&amp;gt;error(&amp;quot;Local Overlay SetRecipients Called&amp;quot;);&lt;br /&gt;
  &lt;br /&gt;
      if ( $arg =~ /\bRequestor\b/ ) {&lt;br /&gt;
          push @To, $ticket-&amp;gt;Requestors-&amp;gt;MemberEmailAddresses;&lt;br /&gt;
 @@ -124,6 +127,14 @@&lt;br /&gt;
          push ( @Bcc, $ticket-&amp;gt;QueueObj-&amp;gt;AdminCc-&amp;gt;MemberEmailAddresses  );&lt;br /&gt;
      }&lt;br /&gt;
  &lt;br /&gt;
 +    if ( $arg =~ /\bQueueAdminCc\b/ ) {&lt;br /&gt;
 +        push ( @Bcc, $ticket-&amp;gt;QueueObj-&amp;gt;AdminCc-&amp;gt;MemberEmailAddresses );&lt;br /&gt;
 +    }&lt;br /&gt;
 +&lt;br /&gt;
 +    if ( $arg =~ /\bTicketAdminCc\b/ ) {&lt;br /&gt;
 +    	push ( @Bcc, $ticket-&amp;gt;AdminCc-&amp;gt;MemberEmailAddresses );&lt;br /&gt;
 +    }&lt;br /&gt;
 +&lt;br /&gt;
      if ( RT-&amp;gt;Config-&amp;gt;Get(&amp;#039;UseFriendlyToLine&amp;#039;) ) {&lt;br /&gt;
          unless (@To) {&lt;br /&gt;
              push @PseudoTo,&lt;br /&gt;
&lt;br /&gt;
==&amp;lt;span style=&amp;quot;font-size:large;&amp;quot;&amp;gt;Updating the Database&amp;lt;/span&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
To make use of the new recipient groups from a Scrip you need to update the RT database.&lt;br /&gt;
&lt;br /&gt;
I followed the instructions on [[WriteCustomAction|Custom Scrip actions]], and followed the layout in the initialData file and created a file dbUpate containing:&lt;br /&gt;
 @ScripActions = (&lt;br /&gt;
         { Name =&amp;gt; &amp;#039;Notify Ticket AdminCcs&amp;#039;,&lt;br /&gt;
           Description =&amp;gt; &amp;#039;Sends Mail to the Ticket AdminCcs&amp;#039;,&lt;br /&gt;
           ExecModule =&amp;gt; &amp;#039;Notify&amp;#039;,&lt;br /&gt;
           Argument =&amp;gt; &amp;#039;TicketAdminCc&amp;#039; },&lt;br /&gt;
         { Name =&amp;gt; &amp;#039;Notify Queue AdminCcs&amp;#039;,&lt;br /&gt;
           Description =&amp;gt; &amp;#039;Sends Mail to the Queue AdminCcs&amp;#039;,&lt;br /&gt;
           ExecModule =&amp;gt; &amp;#039;Notify&amp;#039;,&lt;br /&gt;
           Argument =&amp;gt; &amp;#039;QueueAdminCc&amp;#039; }&lt;br /&gt;
         { Name =&amp;gt; &amp;#039;Notify Ticket AdminCcs as Comment&amp;#039;,&lt;br /&gt;
           Description =&amp;gt; &amp;#039;Sends Mail to the Ticket AdminCcs as Comment&amp;#039;,&lt;br /&gt;
           ExecModule =&amp;gt; &amp;#039;NotifyAsComment&amp;#039;,&lt;br /&gt;
           Argument =&amp;gt; &amp;#039;TicketAdminCc&amp;#039; },&lt;br /&gt;
         { Name =&amp;gt; &amp;#039;Notify Queue AdminCcs as Comment&amp;#039;,&lt;br /&gt;
           Description =&amp;gt; &amp;#039;Sends Mail to the Queue AdminCcs as Comment&amp;#039;,&lt;br /&gt;
           ExecModule =&amp;gt; &amp;#039;NotifyAsComment&amp;#039;,&lt;br /&gt;
           Argument =&amp;gt; &amp;#039;QueueAdminCc&amp;#039; }&lt;br /&gt;
 );&lt;br /&gt;
I then inserted these new actions into the RT database with&lt;br /&gt;
 rt-setup-database-4 --action insert --datafile /path/to/dbUpdate&lt;br /&gt;
as detailed on [[AddDatabaseRecords]].&lt;br /&gt;
==End Result==&lt;br /&gt;
[[File:ScipActions.png|frame|left|New ScripActions now available.]]I updated several of the standard Scips to suit our requirements, so that only Ticket AdminCcs are notified about every ticket correspondence, and Queue AdminCcs are only notified about new tickets in their queues.&lt;br /&gt;
[[Category:Scrip]]&lt;br /&gt;
[[Category:Action]]&lt;br /&gt;
[[Category:Notify]]&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
</feed>