[rt-devel] SetOwner time to past rather than now

Jesse Vincent jesse at bestpractical.com
Mon Feb 24 19:26:52 EST 2003


Have a look at the rt2-to-rt3 importer. You probably want to manually
create the Transaction.

	-j


On Mon, Feb 24, 2003 at 04:22:15PM -0800, Matt Simonsen wrote:
> 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" );
> }
> 
> 
> _______________________________________________
> rt-devel mailing list
> rt-devel at lists.fsck.com
> http://lists.fsck.com/mailman/listinfo/rt-devel

-- 
http://www.bestpractical.com/rt  -- Trouble Ticketing. Free.



More information about the Rt-devel mailing list