<?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=CustomActionQchange</id>
	<title>CustomActionQchange - 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=CustomActionQchange"/>
	<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=CustomActionQchange&amp;action=history"/>
	<updated>2026-08-23T02:50:04Z</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=CustomActionQchange&amp;diff=26427&amp;oldid=prev</id>
		<title>Anthnd: /* Code */</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=CustomActionQchange&amp;diff=26427&amp;oldid=prev"/>
		<updated>2016-11-04T20:03:17Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Code&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;a href=&quot;https://rt-wiki.bestpractical.com/index.php?title=CustomActionQchange&amp;amp;diff=26427&amp;amp;oldid=26423&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>Anthnd</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=CustomActionQchange&amp;diff=26423&amp;oldid=prev</id>
		<title>Jober: minor update</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=CustomActionQchange&amp;diff=26423&amp;oldid=prev"/>
		<updated>2016-11-01T08:47:02Z</updated>

		<summary type="html">&lt;p&gt;minor update&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 04:47, 1 November 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-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&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;Below is a custom action module for adding RT::Action:Qchange via crontool that can be called for via a query similar to this &quot;--action RT::Action::QChange --action-arg &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;YOURQUEUE &lt;/del&gt;--template &#039;blank&#039;&quot;&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;Below is a custom action module for adding RT::Action:Qchange via crontool that can be called for via a query similar to this &quot;--action RT::Action::QChange --action-arg &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;YOURNEWQUEUE &lt;/ins&gt;--template &#039;blank&#039;&quot;&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;/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;Example &amp;lt;code&amp;gt; rt-crontool --transaction last --search RT::Search::FromSQL --search-arg &quot;Queue = &#039;SLA’ AND (Status=&#039;new&#039; OR Status=&#039;open&#039;)&quot; --condition RT::Condition::Overdue --action RT::Action::QChange --action-arg QUEUE --template &#039;SLA-escalation&#039;&amp;lt;/code&amp;gt;&lt;/ins&gt;&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;/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;/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;Create the file in a place where RT can call it (notice not to put it at a place that will be overwritten at an RT upgrade, ex /opt/rt4/lib/RT/Action/Qchange.pm&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;Create the file in a place where RT can call it (notice not to put it at a place that will be overwritten at an RT upgrade, ex /opt/rt4/lib/RT/Action/Qchange.pm&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;This script was created by Andy Smith.&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;This script was created by Andy Smith.&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;&lt;/ins&gt;&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;Running on RT version 4.4.1&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;==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;==Code==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key bestpractical_mediawiki1459887241:diff:1.41:old-26422:rev-26423:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Jober</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=CustomActionQchange&amp;diff=26422&amp;oldid=prev</id>
		<title>Jober: formatting</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=CustomActionQchange&amp;diff=26422&amp;oldid=prev"/>
		<updated>2016-11-01T08:44:45Z</updated>

		<summary type="html">&lt;p&gt;formatting&lt;/p&gt;
&lt;a href=&quot;https://rt-wiki.bestpractical.com/index.php?title=CustomActionQchange&amp;amp;diff=26422&amp;amp;oldid=26421&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>Jober</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=CustomActionQchange&amp;diff=26421&amp;oldid=prev</id>
		<title>Jober: CustomActionQchange, new page.</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=CustomActionQchange&amp;diff=26421&amp;oldid=prev"/>
		<updated>2016-11-01T08:43:16Z</updated>

		<summary type="html">&lt;p&gt;CustomActionQchange, new page.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Below is a custom action module for adding RT::Action:Qchange via crontool that can be called for via a query similar to this &amp;quot;--action RT::Action::QChange --action-arg YOURQUEUE --template &amp;#039;blank&amp;#039;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Create the file in a place where RT can call it (notice not to put it at a place that will be overwritten at an RT upgrade, ex /opt/rt4/lib/RT/Action/Qchange.pm&lt;br /&gt;
&lt;br /&gt;
This script was created by Andy Smith.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&lt;br /&gt;
# BEGIN BPS TAGGED BLOCK {{{&lt;br /&gt;
#&lt;br /&gt;
# COPYRIGHT:&lt;br /&gt;
#&lt;br /&gt;
# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC&lt;br /&gt;
#                                          &amp;lt;sales@bestpractical.com&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
# (Except where explicitly superseded by other copyright notices)&lt;br /&gt;
#&lt;br /&gt;
#&lt;br /&gt;
# LICENSE:&lt;br /&gt;
#&lt;br /&gt;
# This work is made available to you under the terms of Version 2 of&lt;br /&gt;
# the GNU General Public License. A copy of that license should have&lt;br /&gt;
# been provided with this software, but in any event can be snarfed&lt;br /&gt;
# from www.gnu.org.&lt;br /&gt;
#&lt;br /&gt;
# This work is distributed in the hope that it will be useful, but&lt;br /&gt;
# WITHOUT ANY WARRANTY; without even the implied warranty of&lt;br /&gt;
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU&lt;br /&gt;
# General Public License for more details.&lt;br /&gt;
#&lt;br /&gt;
# You should have received a copy of the GNU General Public License&lt;br /&gt;
# along with this program; if not, write to the Free Software&lt;br /&gt;
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA&lt;br /&gt;
# 02110-1301 or visit their web page on the internet at&lt;br /&gt;
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.&lt;br /&gt;
#&lt;br /&gt;
#&lt;br /&gt;
# CONTRIBUTION SUBMISSION POLICY:&lt;br /&gt;
#&lt;br /&gt;
# (The following paragraph is not intended to limit the rights granted&lt;br /&gt;
# to you to modify and distribute this software under the terms of&lt;br /&gt;
# the GNU General Public License and is only of importance to you if&lt;br /&gt;
# you choose to contribute your changes and enhancements to the&lt;br /&gt;
# community by submitting them to Best Practical Solutions, LLC.)&lt;br /&gt;
#&lt;br /&gt;
# By intentionally submitting any modifications, corrections or&lt;br /&gt;
# derivatives to this work, or any other work intended for use with&lt;br /&gt;
# Request Tracker, to Best Practical Solutions, LLC, you confirm that&lt;br /&gt;
# you are the copyright holder for those contributions and you grant&lt;br /&gt;
# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,&lt;br /&gt;
# royalty-free, perpetual, license to use, copy, create derivative&lt;br /&gt;
# works based on those contributions, and sublicense and distribute&lt;br /&gt;
# those contributions and any derivatives thereof.&lt;br /&gt;
#&lt;br /&gt;
# END BPS TAGGED BLOCK }}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
package RT::Action::QChange;&lt;br /&gt;
&lt;br /&gt;
use strict;&lt;br /&gt;
use warnings;&lt;br /&gt;
&lt;br /&gt;
use base qw(RT::Action::Notify);&lt;br /&gt;
&lt;br /&gt;
use Email::Address;&lt;br /&gt;
&lt;br /&gt;
=head1 Notify Owner or AdminCc&lt;br /&gt;
&lt;br /&gt;
If the owner of this ticket is Nobody, notify the AdminCcs.  Otherwise, only notify the Owner.&lt;br /&gt;
&lt;br /&gt;
=cut&lt;br /&gt;
&lt;br /&gt;
sub Prepare {&lt;br /&gt;
  my $self = shift;&lt;br /&gt;
&lt;br /&gt;
  return 1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
my $self;&lt;br /&gt;
&lt;br /&gt;
sub Commit {&lt;br /&gt;
&lt;br /&gt;
  my $self = shift;&lt;br /&gt;
&lt;br /&gt;
my $argument = $self-&amp;gt;Argument;&lt;br /&gt;
    unless ( $argument ) {&lt;br /&gt;
        $RT::Logger-&amp;gt;error(&amp;quot;Argument is mandatory for Test action&amp;quot;);&lt;br /&gt;
        return 0;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
  my ($status, $msg) = $self-&amp;gt;TicketObj-&amp;gt;SetQueue(&amp;quot;$argument&amp;quot;);&lt;br /&gt;
  if ( not $status ) {&lt;br /&gt;
    RT::Logger-&amp;gt;error(&amp;quot;Could not reassign queue: $msg&amp;quot;);&lt;br /&gt;
    return 0;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    RT::Base-&amp;gt;_ImportOverlays();&lt;br /&gt;
&lt;br /&gt;
    return 1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
1;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Contribution]]&lt;/div&gt;</summary>
		<author><name>Jober</name></author>
	</entry>
</feed>