[rt-devel] SetOwner time to past rather than now
Matt Simonsen
matt_lists at careercast.com
Mon Feb 24 19:22:15 EST 2003
I am doing a migration to RT3 from another package. I have a table to
import containing all the times a ticket was reassigned in our old
system.
The code below reassigns the ticket and adds to the history. But it
creates the transaction timestamp as the time the import happens, rather
than the time the reassignment happened. This is the behavior I would
expect, but I am not sure how to change it.
Any tips on how to best go about setting this date?
Thanks
Matt
My code:
elsif ($line[5] =~ m/ASSIGN/) { #Notes that are reassignments
my $tick_object = RT::Ticket->new($RT::SystemUser) ;
$tick_object-> Load ( $line[1] ); #Load ticket note is with
my $created = "$line[2]";
$created =~ s/\.\d+// ; #Remove seconds from import timestamp
#I want this as when the owner changed
my $ChownType = "Force" ;
my $assignedTo = "$line[4]" ; #User+group ticket is assigned to
$assignedTo =~ s/,.*// ; #Take off group from import data
$tick_object->SetOwner( $user_map->{$assignedTo} , "Force" );
}
More information about the Rt-devel
mailing list