[rt-users] Resolved Time Stamp not set if ticket is resolved by Scrip from RT_System
Jesse Vincent
jesse at bestpractical.com
Wed Nov 4 14:23:22 EST 2009
On Wed, Nov 04, 2009 at 11:14:34AM +0100, Brumm, Torsten / Kuehne + Nagel / Ham MI-ID wrote:
> It's from cron:
>
> 0 8 * * * /opt/rt3/bin/rt-crontool --search RT::Search::FromSQL --search-arg " Queue = 'QueueName' AND ( Status = 'delivered' OR Status = 'waiting' ) AND 'CF.{Update Required}' LIKE 'No' AND Starts < 'Today'" --action RT::Action::AutoResolve
>
> I'm not 100% sure anymore where the Action::AutoResolve comes from (found it at our local/lib/ dir) but i think i got it from wiki:
Ah. well, it would need to also set the resolved date, as it's using an
internal API to change the status and record a transaction.
>
> package RT::Action::AutoResolve;
> require RT::Action::Generic;
>
> use strict;
> use vars qw/@ISA/;
> @ISA=qw(RT::Action::Generic);
>
> #Do what we need to do and send it out.
>
> #What does this type of Action does
>
> # {{{ sub Describe
> sub Describe {
> my $self = shift;
> return (ref $self );
> }
> # }}}
>
>
> # {{{ sub Prepare
> sub Prepare {
> my $self = shift;
>
> # if the ticket is already open or the ticket is new and the message is more mail from the
> # requestor, don't reopen it.
>
> my $status = $self->TicketObj->Status;
> return undef if $status eq 'resolved';
>
> return 1;
> }
> # }}}
>
> sub Commit {
> my $self = shift;
> my $oldstatus = $self->TicketObj->Status();
> $self->TicketObj->__Set( Field => 'Status', Value => 'resolved' );
> $self->TicketObj->_NewTransaction(
> Type => 'Status',
> Field => 'Status',
> OldValue => $oldstatus,
> NewValue => 'resolved',
> Data => 'Ticket auto-resolved on cron script action'
> );
>
>
> return(1);
> }
>
> eval "require RT::Action::AutoResolve_Vendor";
> die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/AutoResolve_Vendor.pm});
> eval "require RT::Action::AutoResolve_Local";
> die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/AutoResolve_Local.pm});
>
> 1;
>
>
> Kuehne + Nagel (AG & Co.) KG, Geschaeftsleitung: Hans-Georg Brinkmann (Vors.), Dirk Blesius (Stellv.), Reiner Heiken (Stellv.), Bruno Mang, Alfred Manke, Christian Marnetté (Stellv.), Mark Reinhardt (Stellv.), Jens Wollesen, Rainer Wunn, Sitz: Bremen, Registergericht: Bremen, HRA 21928, USt-IdNr.: DE 812773878, Persoenlich haftende Gesellschaft: Kuehne & Nagel A.G., Sitz: Contern/Luxemburg Geschaeftsfuehrender Verwaltungsrat: Klaus-Michael Kuehne
>
>
>
> -----Urspruengliche Nachricht-----
> Von: Jesse Vincent [mailto:jesse at bestpractical.com]
> Gesendet: Dienstag, 3. November 2009 15:18
> An: Brumm, Torsten / Kuehne + Nagel / Ham MI-ID
> Cc: Jesse Vincent; rt-users at lists.bestpractical.com
> Betreff: Re: [rt-users] Resolved Time Stamp not set if ticket is resolved by Scrip from RT_System
>
>
>
>
> On Tue, Nov 03, 2009 at 12:07:49PM +0100, Brumm, Torsten / Kuehne + Nagel / Ham MI-ID wrote:
> > I'd love to do this, drop me a tiny hint where to start from ;-)
> >
>
> First up, what scrip is doing the resolving? What's the ScripAction?
>
--
More information about the rt-users
mailing list