<div dir="ltr"><div>Due date delay works! <br></div><div>However, when I change the status from Stalled to Open, the due date becomes again the original one. Is there a way to avoid it? <br><br></div><div>Cheers Andy<br></div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-03-05 11:23 GMT+01:00 Pablo Fernandez <span dir="ltr"><<a href="mailto:pablo.fernandez@cscs.ch" target="_blank">pablo.fernandez@cscs.ch</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
Thanks for the hint... I was able to do what I needed. <br>
I post here the contents of the local/lib/RT/Action/DelayDue.pm
script, for others that may need it:<br>
<br>
----<br>
package RT::Action::DelayDue;<br>
use base 'RT::Action';<br>
<br>
use strict;<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>
sub Describe {<br>
my $self = shift;<br>
return (ref $self . " will increase the ticket Due Date to the
argument provided in minutes.");<br>
}<br>
# }}}<br>
<br>
<br>
# {{{ sub Prepare <br>
sub Prepare {<br>
# nothing to prepare<br>
return 1;<br>
}<br>
# }}}<br>
<br>
sub Commit {<br>
my $self = shift;<br>
my $due = $self->TicketObj->DueObj();<br>
if ($due->Unix() > 1) {<br>
$due->AddSeconds( $self->Argument * 60 );<br>
$self->TicketObj->SetDue($due->ISO);<br>
}<br>
}<br>
<br>
RT::Base->_ImportOverlays();<br>
<br>
1;<br>
----<br>
<br>
<br>
And a nice crontool that runs every hour:<br>
<br>
/opt/rt3/bin/rt-crontool --search RT::Search::FromSQL --search-arg
"Queue = 'z1-rt' AND Status = 'stalled'" --action
RT::Action::DelayDue --action-arg 60 --verbose<br>
<br>
<br>
Hope it helps! Thanks again for the help!<br>
BR/Pablo<div><div class="h5"><br>
<br>
<br>
<br>
<div>On 03/04/2014 08:40 PM, Kevin Falcone
wrote:<br>
</div>
<blockquote type="cite">
<pre>On Mon, Mar 03, 2014 at 09:55:08PM +0000, Fernandez Pablo wrote:
</pre>
<blockquote type="cite">
<blockquote type="cite">
<pre>On Mar 3, 2014 8:40 PM, Kevin Falcone <a href="mailto:falcone@bestpractical.com" target="_blank"><falcone@bestpractical.com></a> wrote:
On Fri, Feb 28, 2014 at 11:58:27AM +0100, Pablo Fernandez wrote:
</pre>
<blockquote type="cite">
<pre>I was wondering... is there a way I can delay (a fixed amount of time)
the Due Date on all tickets that match some criteria (like being in
stalled state)?
I was thinking of using rt-crontool for that task as a sort of way to
"park" tickets (a cron job that runs every hour and delays 1 hour all
stalled tickets).
</pre>
</blockquote>
<pre>Sounds like you want rt-crontool?
<a href="http://bestpractical.com/docs/rt/latest/rt-crontool.html" target="_blank">http://bestpractical.com/docs/rt/latest/rt-crontool.html</a>
<a href="http://bestpractical.com/docs/rt/latest/automating_rt.html" target="_blank">http://bestpractical.com/docs/rt/latest/automating_rt.html</a>
</pre>
</blockquote>
<pre>But among the actions, I did not find any to change the due date (and neither in the two links )
Any hints on how to do that?
</pre>
</blockquote>
<pre>You'll have to provide your own action in
local/lib/RT/Action/CustomDueMunging.pm
Likely you want a Prepare of { return 1}; and then you'll have your
real logic in Commit.
-kevin
</pre>
<br>
<fieldset></fieldset>
<br>
</blockquote>
<br>
</div></div></div>
<br>--<br>
RT Training London, March 19-20 and Dallas May 20-21<br>
<a href="http://bestpractical.com/training" target="_blank">http://bestpractical.com/training</a><br></blockquote></div><br></div>