<%INIT>
if( RT->Config->Get('LuciaAllowModifyResolved') || $session{CurrentUser}->HasRight( Right => 'SuperUser', Object => RT->System ) ){
    # Set date fields
    my @date_fields = qw(
        Resolved
    );

    # Run through each field in this list. update the value if apropriate
    foreach my $field (@date_fields) {
        next unless exists $ARGSRef->{ $field . '_Date' };
        next if $ARGSRef->{ $field . '_Date' } eq '';

        my ( $code, $msg );

        my $DateObj = RT::Date->new( $session{'CurrentUser'} );
        $DateObj->Set(
            Format => 'unknown',
            Value  => $ARGSRef->{ $field . '_Date' }
        );

        my $obj = $field . "Obj";
        if ( $DateObj->Unix != $TicketObj->$obj()->Unix() ) {
            my $method = "Set$field";
            my ( $code, $msg ) = $TicketObj->$method( $DateObj->ISO );
        }
    }
}
</%INIT>

<%ARGS>
$TicketObj => undef
$ARGSRef  => {}
$results => undef
</%ARGS>
