Set the Completed By custom field to the CurrentUser

I looked at a similar question pertaining to setting a custom field to the CurrentUser when the status changes from open to resolved, but I get the same error message. I created a scrip that runs when the Condition is “On Resolve”, the Action is User Defined and the Template is “Transaction in HTML”.

In the custom condition I have the following code:
my $ticket = $self->TicketObj;
return 0 unless $ticket->Status eq ‘resolved’;

In my custom action preparation code I have:
my $ticket = $self->TicketObj;
my $CurrentUser = $self->CurrentUser->Name;
my $CFName = ‘Completed By’;

$ticket->AddCustomFieldValue ( Field => $CFName, Value => $CurrentUser, RecordTransaction => 1 );
return 1;

When I change the status from ‘open’ to ‘resolved’ on a ticket I get the following message - “RT_System is no longer a value for custom field Completed By”.

Anyone have any ideas about how to grab the CurrentUser when status is changed and update my custom field “Completed By” with the CurrentUser who is logged in to Request Tracker and who changed the status?