<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"MS Mincho";
        panose-1:2 2 6 9 4 2 5 8 3 4;}
@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:"\@MS Mincho";
        panose-1:2 2 6 9 4 2 5 8 3 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.E-postmall17
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.E-postmall18
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
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 bgcolor="white" lang="SV" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">Hello,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">Indeed you are right, and I found a guy named Andy Smith in the UK that solved the problem, I’ve attached his solution to the email (not sure if attachments works). Put it in rt4/lib/RT/Action/QChange.pm
 and then call it with relevant query with: --action RT::Action::QChange --action-arg YOURQUEUE --template 'blank'<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">Works like a charm, I use it in this way for SLA purposes to escalate a TT that passes over the defined ServiceAgreement:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">rt-crontool --transaction last --search RT::Search::FromSQL --search-arg "Queue = 'SLA’ AND (Status='new' OR Status='open')" --condition RT::Condition::Overdue --action RT::Action::QChange --action-arg
 QUEUE --template 'SLA-escalation'<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">Regards, Joel<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="color:windowtext">Från:</span></b><span style="color:windowtext"> rt-users [mailto:rt-users-bounces@lists.bestpractical.com]
<b>För </b>Emmanuel Lacour<br>
<b>Skickat:</b> den 18 oktober 2016 16:01<br>
<b>Till:</b> rt-users@lists.bestpractical.com<br>
<b>Ämne:</b> Re: [rt-users] rt-crontool on condition x change queue<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">Le 18/10/2016 ā 11:03, Joel Bergmark a écrit :<span style="font-size:12.0pt"><o:p></o:p></span></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal">Hi,<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">Just a quick one this time, is there any easy way to use rt crontool get something like this working:<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">/opt/rt4/bin/rt-crontool --search RT::Search::FromSQL --search-arg "Queue = 'X' AND (Status='new' OR Status='open')" --condition RT::Condition::Overdue --action RT::Queue  "Newqueue"
<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">I know its not really under rt::action but is there a way to call upon rt::queue from this? Tried a bunch of different syntax but get “RT::Queue::Prepare Unimplemented in main.”<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
</blockquote>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-size:12.0pt;font-family:"Times New Roman",serif"><br>
<br>
there is no stock SetQueue RT action, you have to write it yourself. Just put the following content (untested) in rt/local/lib/RT/Action/SetQueue.pm and call it like this:<br>
<br>
/opt/rt4/bin/rt-crontool --search RT::Search::FromSQL --search-arg "Queue = 'X' AND (Status='new' OR Status='open')" --condition RT::Condition::Overdue --action SetQueue --action-arg "Newqueue"<br>
<br>
<br>
------------------------------------ cut ------------------------------------<br>
package RT::Action::SetQueue;<br>
use base 'RT::Action';<br>
<br>
use strict;<br>
use warnings;<br>
<br>
<br>
sub Describe  {<br>
  my $self = shift;<br>
  return (ref $self . " will set a ticket's queue to the argument provided.");<br>
}<br>
<br>
<br>
sub Prepare  {<br>
    return 1;<br>
}<br>
<br>
sub Commit {<br>
    my $self = shift;<br>
    $self->TicketObj->SetQueue($self->Argument);<br>
<br>
}<br>
<br>
1;<br>
------------------------------------ cut ------------------------------------<br>
<br>
<o:p></o:p></span></p>
</div>
</body>
</html>