Fixing last-update info when importing tickets from elsewhere

Hi,

I am in the process of developing the scripts to migrate a large number
of tickets from a third party system into RT 3.8. I have almost
everything working now. The one thing I cannot seem to do, though, is
get the LastUpdated and LastUpdatedBy set to anything other than the
current time and user.

Ideally I just want to be able to do:

$tkobj->SetLastUpdated($lastt->{Created}) ;
$tkobj->SetLastUpdatedBy($lastt->{Creator}) ;

($tkobj is my ticket object; $lastt is my scripts representation of the
last transaction)

But this has no effect. Looking through the code, I can see that
RT::Record hooks an automatic update of these values into _Set which
makes sense but if that were the culprit I’d expect the above to set the
user correctly but not the time. However, this isn’t happening.

I haven’t gone as far as debugging it yet to see what’s happening (or
what’s not happening) under the hood; I thought I’d ask on the list
before doing that - I may be going about this in completely the wrong
way.

Thanks,

Olly

PS> I tried adding

$tkobj->{’_AccessibleCache’}{LastUpdated} = { ‘read’ => 1, ‘write’ =>
1 };
$tkobj->{’_AccessibleCache’}{LastUpdatedBy} = { ‘read’ => 1, ‘write’ =>
1 };

before calling the functions to make sure they can be set but that
didn’t help

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

Hi,

I am in the process of developing the scripts to migrate a large
number
of tickets from a third party system into RT 3.8. I have almost
everything working now. The one thing I cannot seem to do, though, is
get the LastUpdated and LastUpdatedBy set to anything other than the
current time and user.

Ideally I just want to be able to do:

$tkobj->SetLastUpdated($lastt->{Created}) ;
$tkobj->SetLastUpdatedBy($lastt->{Creator}) ;

$tckobj->__Set( Field => ‘LastUpdated’, Value => ‘some value’);