[rt-users] LastUpdated should be ignored by ModifyDates

Ruslan Zakirov ruz at bestpractical.com
Fri Jun 22 10:46:21 EDT 2007

On 6/21/07, Mathew Snyder <theillien at yahoo.com> wrote:
> joey wrote:
> > Hey,
> >
> > noone around having an idea? :/
> >
> > joey wrote:
> >> I tried around alot, but i can't get it to work. I need the
> >> LastUpdated-field not to be changed when someone changes the Due-Date of
> >> a ticket.
> >>
> >> This is what i acutally want to set-up:
> >> A tool (rt-crontool for ex.) that searches tickets that has not been
> >> modified since a given period of time. Modified means neither a comment
> >> nor a correspondence. Modifying the Due-Date, Priority or whatever
> >> should be ignored.
> >
> >
> We use a patch suppled by a user that, after applied, prevents the Last Updated
> time to change.  It applies the change to EscalatePriority.pm but I would
> imagine all you'd have to do is alter the other necessary subs in other files:
> sub Commit {
>      my $self = shift;
> -   my ($val, $msg) = $self->TicketObj->SetPriority($self->{'prio'});
> +   my ($val, $msg) = $self->TicketObj->__Set(Field => 'Priority', Value =>
> $self->{'prio'}, RecordTransaction => 0);
> 'RecordTransaction => 0' is what you want.
Mathew, method __Set is the lowest one in the group of setters. This
method just update a field, without writing transactions, ACL checks
or auto-updating LastUpdated and LastUpdatedBy fields. So in your
situation RecordTransaction argument is useless.

Joey, RecordTransaction argument is available in _Set method, but
anyway LastUpdated and LastUpdatedBy fields are auto-updated when you
use it, so the only way for is to use __Set method:
  $ticket_obj->__Set( Field => 'Due', Value => $due_obj->ISO );

However, I must warn you. This method doesn't write transactions, so
any scrip that triggers on  due change will skip this change as such
change doesn't exist for scrips.

> Mathew

Best regards, Ruslan.

More information about the rt-users mailing list