<?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=OnQueueChangeResetPriorityAndDueDate</id>
	<title>OnQueueChangeResetPriorityAndDueDate - 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=OnQueueChangeResetPriorityAndDueDate"/>
	<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=OnQueueChangeResetPriorityAndDueDate&amp;action=history"/>
	<updated>2026-08-23T01:49:23Z</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=OnQueueChangeResetPriorityAndDueDate&amp;diff=26343&amp;oldid=prev</id>
		<title>Tharn: /* Custom action cleanup code: */</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=OnQueueChangeResetPriorityAndDueDate&amp;diff=26343&amp;oldid=prev"/>
		<updated>2016-08-13T23:16:17Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Custom action cleanup code:&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 19:16, 13 August 2016&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-l11&quot;&gt;Line 11:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 11:&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;  return 1;&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;  return 1;&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;div&gt;===Custom action cleanup code:===&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;===Custom action cleanup code:===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&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;&amp;lt;pre&amp;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;div&gt;  my $queue_id = $self-&amp;gt;TransactionObj-&amp;gt;NewValue;&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;  my $queue_id = $self-&amp;gt;TransactionObj-&amp;gt;NewValue;&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;div&gt;  my $queue = RT::Queue-&amp;gt;new( $RT::SystemUser );&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;  my $queue = RT::Queue-&amp;gt;new( $RT::SystemUser );&lt;/div&gt;&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-l53&quot;&gt;Line 53:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 54:&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;  }&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;  }&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;div&gt;  return 1;&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;  return 1;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&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;&amp;lt;/pre&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key bestpractical_mediawiki1459887241:diff:1.41:old-2430:rev-26343:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Tharn</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=OnQueueChangeResetPriorityAndDueDate&amp;diff=2430&amp;oldid=prev</id>
		<title>Admin: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=OnQueueChangeResetPriorityAndDueDate&amp;diff=2430&amp;oldid=prev"/>
		<updated>2016-04-06T20:15:50Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&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 16:15, 6 April 2016&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;4&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff cache key bestpractical_mediawiki1459887241:diff:1.41:old-2429:rev-2430 --&gt;
&lt;/table&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=OnQueueChangeResetPriorityAndDueDate&amp;diff=2429&amp;oldid=prev</id>
		<title>70.190.64.174: Initial version of OnQueueChangeResetPriorityAndDueDate</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=OnQueueChangeResetPriorityAndDueDate&amp;diff=2429&amp;oldid=prev"/>
		<updated>2011-06-04T05:19:32Z</updated>

		<summary type="html">&lt;p&gt;Initial version of OnQueueChangeResetPriorityAndDueDate&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==On Queue Change Set Priority And DueDate==&lt;br /&gt;
This Scrip will reset the priority and due dates to the default queue values on a ticket when the queue is change.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Description&amp;#039;&amp;#039;&amp;#039;: On Queue Change Set Priority and DueDate&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Condition&amp;#039;&amp;#039;&amp;#039;: On Queue Change&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Action&amp;#039;&amp;#039;&amp;#039;: User Defined&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Template&amp;#039;&amp;#039;&amp;#039;: Global template: Blank&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Stage&amp;#039;&amp;#039;&amp;#039;: TransactionBatch&lt;br /&gt;
===Custom Condition:===&lt;br /&gt;
 # blank&lt;br /&gt;
===Custom action preparation code:===&lt;br /&gt;
 return 1;&lt;br /&gt;
===Custom action cleanup code:===&lt;br /&gt;
 my $queue_id = $self-&amp;gt;TransactionObj-&amp;gt;NewValue;&lt;br /&gt;
 my $queue = RT::Queue-&amp;gt;new( $RT::SystemUser );&lt;br /&gt;
 $queue-&amp;gt;Load( $queue_id );&lt;br /&gt;
 &lt;br /&gt;
 # Reset Priority&lt;br /&gt;
 unless ( $self-&amp;gt;TicketObj-&amp;gt;Priority == $queue-&amp;gt;InitialPriority ) {&lt;br /&gt;
   $RT::Logger-&amp;gt;info(&amp;quot;On Queue Change set ticket #&amp;quot;. $self-&amp;gt;TicketObj-&amp;gt;id .&amp;quot; priority to &amp;quot;. $queue-&amp;gt;InitialPriority );&lt;br /&gt;
   my ( $status, $msg ) = $self-&amp;gt;TicketObj-&amp;gt;SetPriority( $queue-&amp;gt;InitialPriority );&lt;br /&gt;
   unless ( $status ) {&lt;br /&gt;
     $RT::Logger-&amp;gt;error( &amp;quot;Unable to assign priority to &amp;quot;. $queue-&amp;gt;InitialPriority );&lt;br /&gt;
     $RT::Logger-&amp;gt;error( &amp;quot;Message: $msg&amp;quot; );&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
 # Reset Final Priority&lt;br /&gt;
 unless ( $self-&amp;gt;TicketObj-&amp;gt;FinalPriority == $queue-&amp;gt;FinalPriority ) {&lt;br /&gt;
   $RT::Logger-&amp;gt;info(&amp;quot;On Queue Change set ticket #&amp;quot;. $self-&amp;gt;TicketObj-&amp;gt;id .&amp;quot; final priority to &amp;quot;. $queue-&amp;gt;FinalPriority );&lt;br /&gt;
   my ( $status, $msg ) = $self-&amp;gt;TicketObj-&amp;gt;SetFinalPriority( $queue-&amp;gt;FinalPriority );&lt;br /&gt;
   unless ( $status ) {&lt;br /&gt;
     $RT::Logger-&amp;gt;error( &amp;quot;Unable to assign final priority to &amp;quot;. $queue-&amp;gt;FinalPriority );&lt;br /&gt;
     $RT::Logger-&amp;gt;error( &amp;quot;Message: $msg&amp;quot; );&lt;br /&gt;
   }&lt;br /&gt;
 }  &lt;br /&gt;
 &lt;br /&gt;
 # Reset Due Date&lt;br /&gt;
 my $due_date = RT::Date-&amp;gt;new( $RT::SystemUser );&lt;br /&gt;
 $due_date-&amp;gt;Set( Format =&amp;gt; &amp;#039;ISO&amp;#039;, Value =&amp;gt; $self-&amp;gt;TicketObj-&amp;gt;Due );&lt;br /&gt;
 &lt;br /&gt;
 # If queue doesn&amp;#039;t specify due date, then clear this tickets due date.&lt;br /&gt;
 # Otherwise, add that many days.&lt;br /&gt;
 if ( $queue-&amp;gt;DefaultDueIn == 0 ) {&lt;br /&gt;
   $due_date-&amp;gt;Set( Format =&amp;gt; &amp;#039;ISO&amp;#039;, Value =&amp;gt; 0 );&lt;br /&gt;
 } else {&lt;br /&gt;
   $due_date-&amp;gt;SetToNow;&lt;br /&gt;
   $due_date-&amp;gt;AddDays( $queue-&amp;gt;DefaultDueIn );&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 $RT::Logger-&amp;gt;info(&amp;quot;On Queue Change set ticket #&amp;quot;. $self-&amp;gt;TicketObj-&amp;gt;id .&amp;quot; due date to &amp;quot;. $due_date-&amp;gt;ISO );&lt;br /&gt;
 my ( $status, $msg ) = $self-&amp;gt;TicketObj-&amp;gt;SetDue( $due_date-&amp;gt;ISO );&lt;br /&gt;
 unless ( $status ) {&lt;br /&gt;
   $RT::Logger-&amp;gt;error( &amp;quot;Unable to assign due date to &amp;quot;. $due_date-&amp;gt;ISO );&lt;br /&gt;
 }&lt;br /&gt;
 return 1;&lt;/div&gt;</summary>
		<author><name>70.190.64.174</name></author>
	</entry>
</feed>