<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Thanks Landon for the tips and info. The suggestions are working great and I am moving on.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Also by the way there is not an action of this type in the actions directory.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Again Thanks<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:black">Bryon Baker<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:black">Network Operations Manager<o:p></o:p></span></p>
<p class="MsoNormal"><b><i><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:red">Copesan</span></i></b><b><i><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:black"> - Specialists in Pest Solutions<o:p></o:p></span></i></b></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:black">800-267-3726 • 262-783-6261 ext. 2296<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D"><a href="mailto:cstephan@copesan.com">bbaker@copesan.com</a><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:black"><a href="http://www.copesan.com/"><span style="color:black">www.copesan.com</span></a><o:p></o:p></span></p>
<p class="MsoNormal"><b><i><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:red">"Servicing North America with Local Care"</span></i></b><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Landon Stewart [mailto:lstewart@iweb.com]
<br>
<b>Sent:</b> Thursday, September 26, 2013 5:57 PM<br>
<b>To:</b> Bryon Baker<br>
<b>Cc:</b> RT Users<br>
<b>Subject:</b> Re: [rt-users] Change Queue<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<div>
<p class="MsoNormal">On 26 September 2013 10:45, Bryon Baker <<a href="mailto:bbaker@copesan.com" target="_blank">bbaker@copesan.com</a>> wrote:<o:p></o:p></p>
<p class="MsoNormal">Ok tried something on my own I copied "SetPriority.pm" module to ChangeQueue.pm and change code to<br>
<br>
When I try and execute this with rt-crontool I get<br>
<br>
[Thu Sep 26 17:39:21 2013] [critical]: Failed to load module RT::Action::ChangeQueue. () at /usr/bin/rt-crontool line 305. (/usr/lib/perl5/vendor_perl/5.16.2/RT.pm:400)<br>
Failed to load module RT::Action::ChangeQueue. () at /usr/bin/rt-crontool line 305.<br>
<br>
I have compared the permissions on both file and everything looks the same.<br>
<br>
package RT::Action::ChangeQueue;<br>
use base 'RT::Action';<br>
<br>
use strict;<br>
use warnings;<br>
<br>
#Do what we need to do and send it out.<br>
<br>
#What does this type of Action does<br>
<br>
sub Describe {<br>
my $self = shift;<br>
return (ref $self . " will set a ticket's priority to the argument provided.");<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">That looks weird… ref $self? That'd probably return "HASH will set ticket's…" or something. I'd nuke it entirely anyway since you don't need this sub.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal">sub Prepare {<br>
# nothing to prepare<br>
return 1;<br>
}<o:p></o:p></p>
</blockquote>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Nuke this since you don't need it.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal">sub Commit {<br>
my $self = shift;<br>
my $currentqueue = $<b>ticket</b>->Queue;<o:p></o:p></p>
</blockquote>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">You haven't dereferenced $self->TicketObj into $ticket yet above.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal">## Did this to validate what is happening before I do it.<br>
print "Current Queue $currentqueue, New Queue <b>$self->Argument</b>\n";<br>
# $self->TicketObj->SetQueue($self->Argument);<br>
<br>
}<o:p></o:p></p>
</blockquote>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">This print line would be interpreted as:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">print "Current Queue ".$currentqueue.", New Queue ".$self."->Argument\n"; <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Probably not what you want… <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><b><u>By the way there might already be an action called SetQueue.pm in your lib/RT/Actions/ directory.</u></b><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">If you want to keep working on your module though - try this. This ChangeQueue.pm should be located in /opt/rt4/lib/RT/Action/ or equivalent. I've removed SetQueue() like you did so it won't actually modify the ticket.<o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New"">package RT::Action::ChangeQueue;<br>
use base 'RT::Action';<br>
<br>
use strict;<br>
use warnings;<br>
<br>
sub Commit {<br>
my $self = shift;</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New""> my $ticket = $self->TicketObj;<br>
my $cq = $ticket->Queue;</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New""> my $nq = $self->Argument;</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New""><br>
print "Current Queue $cq, New Queue $nq\n";</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New""> # or</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New""> print "Current Queue ".$self->TicketObj->Queue.", New Queue ".$self->Argument."\n";</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New""> # or</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New""> print "Current Queue ".$ticket->Queue.", New Queue ".$self->Argument."\n";</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New"">}</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New""><br>
RT::Base->_ImportOverlays();<br>
<br>
1;</span><o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Give this line a new Queue ID# and a ticket # and watch the magic:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">/opt/rt4/bin/rt-crontool --search RT::Search::FromSQL --action RT::Action::ChangeQueue --action-arg "<qid>" --transaction first --verbose --search-arg 'id = <ticketid>'<o:p></o:p></p>
</div>
</div>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal">-- <o:p></o:p></p>
<div>
<div>
<p class="MsoNormal"><span style="font-family:"Arial","sans-serif"">Landon Stewart ::
</span><a href="mailto:lstewart@iweb.com" target="_blank"><span style="font-family:"Arial","sans-serif"">lstewart@iweb.com</span></a><o:p></o:p></p>
</div>
<p class="MsoNormal"><span style="font-family:"Arial","sans-serif"">Lead Specialist, Abuse and Security Management<br>
Spécialiste principal, gestion des abus et sécurité<br>
<a href="http://iweb.com" target="_blank">http://iweb.com</a> :: +1 (888) 909-4932</span><o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>