<?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=OnOwnershipSquelchMailtoQueueWatchers</id>
	<title>OnOwnershipSquelchMailtoQueueWatchers - 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=OnOwnershipSquelchMailtoQueueWatchers"/>
	<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=OnOwnershipSquelchMailtoQueueWatchers&amp;action=history"/>
	<updated>2026-08-23T16:31:43Z</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=OnOwnershipSquelchMailtoQueueWatchers&amp;diff=2424&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=OnOwnershipSquelchMailtoQueueWatchers&amp;diff=2424&amp;oldid=prev"/>
		<updated>2016-04-06T20:15:50Z</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;This is a scrip action that I found multiple requests for while I was looking for it myself, but I couldn&amp;#039;t find any example of code that did what I wanted it to do:&lt;br /&gt;
&lt;br /&gt;
If a ticket goes from being owned by &amp;quot;Nobody&amp;quot; to being owned by a regular user, anyone who is &amp;#039;&amp;#039;just&amp;#039;&amp;#039; an [[AdminCcs|AdminCc]] because they are assigned as a [[Watcher]] for that Queue. If they&amp;#039;re the [[Requestor]], [[Owner]], or have been assigned as a [[CC]] or AdminCc for the ticket itself, they keep getting mail.&lt;br /&gt;
==Scrip fields==&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Description:&amp;#039;&amp;#039;&amp;#039;  On Initial Ownership Remove Queue Watchers&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Condition:&amp;#039;&amp;#039;&amp;#039;  User Defined&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Action:&amp;#039;&amp;#039;&amp;#039; User Defined&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Template:&amp;#039;&amp;#039;&amp;#039; Global template: Blank&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Stage:&amp;#039;&amp;#039;&amp;#039; Transaction Create&lt;br /&gt;
&lt;br /&gt;
==User Defined conditions and actions==&lt;br /&gt;
&lt;br /&gt;
Custom Condition: (from [[CustomConditionSnippets#On_Owner_Change_from_Nobody_to_Any|Custom Condition Snippets]])&lt;br /&gt;
 my $txn = $self-&amp;gt;TransactionObj;&lt;br /&gt;
 return 0 unless $txn-&amp;gt;Type eq &amp;quot;Set&amp;quot;;&lt;br /&gt;
 return 0 unless $txn-&amp;gt;Field eq &amp;quot;Owner&amp;quot;;&lt;br /&gt;
 return 0 unless $txn-&amp;gt;OldValue == $RT::Nobody-&amp;gt;id;&lt;br /&gt;
 return 1;&lt;br /&gt;
Custom action preparation code:&lt;br /&gt;
 return 1;&lt;br /&gt;
Custom action cleanup code:&lt;br /&gt;
 my $t = $self-&amp;gt;TicketObj;&lt;br /&gt;
 my $q = $self-&amp;gt;TicketObj-&amp;gt;QueueObj;&lt;br /&gt;
 my $q_accs = $q-&amp;gt;AdminCc-&amp;gt;UserMembersObj;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 while (my $q_u = $q_accs-&amp;gt;Next) {&lt;br /&gt;
     unless ($t-&amp;gt;IsAdminCc($q_u-&amp;gt;id) or $t-&amp;gt;IsCc($q_u-&amp;gt;id) or $t-&amp;gt;IsRequestor($q_u-&amp;gt;id) or $t-&amp;gt;IsOwner($q_u)) {&lt;br /&gt;
         $t-&amp;gt;SquelchMailTo($q_u-&amp;gt;EmailAddress);&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
 return 1;&lt;br /&gt;
[[Category:Contribution]]&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
</feed>