仅在某个特定字段更新时添加注释

On the admin side of Gravity form, I want to add a note if an admin user changes the status of the form entry. I have an admin only field so that bit is working and I know how to add note.

But can't work out, how to add note only if a certain field is changed. I need it to say something like 'status was updated from "approved" to "closed" by xxx'

Any help would be much appreciated.

Thanks.

add_action( 'gform_after_update_entry', function ( $form, $entry_id ) {

    $current_user = wp_get_current_user();
    $note = 'status updated from' . $status_from . ' to ' . $status_to . ' by ' . $current_user;
    RGFormsModel::add_note( $entry_id, $current_user->ID, $current_user->display_name, $not );
}, 10, 2 );

Worked it out. For anyone who may need it. Answer below :)

add_action( 'gform_after_update_entry', 'update_entry', 10, 3 );
function update_entry( $form, $id, $original ) {

    $entry = GFAPI::get_entry( $id );

    $status_from = $original[ID_OF_THE_FIELD];
    $status_to = $entry[ID_OF_THE_FIELD];

    if($status_from != $status_to) {
        $current_user = wp_get_current_user();
        $message = 'Status updated from ' . $status_from . ' to ' . $status_to . ' by ' . $current_user->display_name;
        RGFormsModel::add_note( $entry_id, $current_user->ID, $current_user->display_name, $message );
    }
}