<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html><body style='font-family: Verdana,Geneva,sans-serif'>
<pre>Hi Landon et al,
for any interested I did finally get this working, the trick was adding "RT::Base->_ImportOverlays();" before the final "return 1" in the commit subroutine. Once I added this the Scrip with condition on queue change started working as per when changing queues via the GUI.
So in case anyone else wants a custom action they can use from rt-crontool for changing queues here is my final code:
</pre>
<p><span style="font-family: 'courier new', courier;">package RT::Action::QChange;</span></p>
<p><span style="font-family: 'courier new', courier;">use strict;</span><br /><span style="font-family: 'courier new', courier;">use warnings;</span></p>
<p><span style="font-family: 'courier new', courier;">use base qw(RT::Action::Notify);</span></p>
<p><span style="font-family: 'courier new', courier;">use Email::Address;</span></p>
<p><span style="font-family: 'courier new', courier;">sub Prepare {</span><br /><span style="font-family: 'courier new', courier;"> my $self = shift;</span></p>
<p><span style="font-family: 'courier new', courier;">return 1;</span><br /><span style="font-family: 'courier new', courier;">}</span></p>
<p><span style="font-family: 'courier new', courier;">my $self;</span></p>
<p><span style="font-family: 'courier new', courier;">sub Commit {</span></p>
<p><span style="font-family: 'courier new', courier;">my $self = shift;</span></p>
<p><span style="font-family: 'courier new', courier;">my $argument = $self->Argument;</span><br /><span style="font-family: 'courier new', courier;"> unless ( $argument ) {</span><br /><span style="font-family: 'courier new', courier;"> $RT::Logger->error("Argument is mandatory for Test action");</span><br /><span style="font-family: 'courier new', courier;"> return 0;</span><br /><span style="font-family: 'courier new', courier;"> }</span></p>
<p><span style="font-family: 'courier new', courier;">my ($status, $msg) = $self->TicketObj->SetQueue("$argument");</span><br /><span style="font-family: 'courier new', courier;"> if ( not $status ) {</span><br /><span style="font-family: 'courier new', courier;"> RT::Logger->error("Could not reassign queue: $msg");</span><br /><span style="font-family: 'courier new', courier;"> return 0;</span><br /><span style="font-family: 'courier new', courier;"> }</span></p>
<p><br /><span style="font-family: 'courier new', courier;"> RT::Base->_ImportOverlays();</span></p>
<p><span style="font-family: 'courier new', courier;">return 1;</span><br /><span style="font-family: 'courier new', courier;">}</span></p>
<p><span style="font-family: 'courier new', courier;">1;</span></p>
<pre><span style="font-family: Verdana, Geneva, sans-serif;"><span style="white-space: normal;">
</span></span></pre>
</body></html>