<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Le 18/10/2016 à 11:03, Joel Bergmark a
écrit :<br>
</div>
<blockquote
cite="mid:DB5PR07MB10317609638E97621A3F3B54A0D30@DB5PR07MB1031.eurprd07.prod.outlook.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<meta name="Generator" content="Microsoft Word 15 (filtered
medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]-->
<style><!--
/* Font Definitions */
@font-face
{font-family:Helvetica;
panose-1:2 11 6 4 2 2 2 2 2 4;}
@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;}
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-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;}
@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]-->
<div class="WordSection1">
<p class="MsoNormal">Hi,</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Just a quick one this time, is there any
easy way to use rt crontool get something like this working:</p>
<p class="MsoNormal"> </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" </p>
<p class="MsoNormal"> </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.”</p>
<p class="MsoNormal"> </p>
</div>
</blockquote>
<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>
<br>
</body>
</html>