After much struggle I realized that this is an authorization issue of sorts.
Under normal circumstances the above myOnEdit
does not need to be authorized, and if executed manually it does not ask for authorization. It executes flawlessly -- just without the user
info.
If, however, the following line (or something similar) appears somewhere -- anywhere -- in the script, that solves the problem:
Session.getActiveUser().getEmail();
The existence of this line forces the authorization request to appear when any function in the script is ran manually and once this authorization is granted, the result
of the original myOnEdit
will include the user
property.
Yay!