BigMikeyVegas
Kilo Sage

The answer has been found. There was a reply by @manishm on this post. Edits to the code are in Red. I added an attachment to show the results.

______________________________________________________________________________________

Changes to Approvals Widget that shows up on the index page to capture Rejection Comments:

Server Script 

if (input.op == 'approved' || input.op == 'rejected') {
var app = new GlideRecord("sysapproval_approver");
if (app.get(input.target)) {
app.state = input.op;
if (input.comments) {
app.comments = input.comments;
}
app.update();
}
}

 

Client Controller

function ($scope, spUtil, spUIActionsExecuter, spModal) {

...

$scope.reject = function(id, esigRequired) {
var requestParams = {
username: $scope.data.esignature.username,
userSysId: $scope.data.esignature.userSysId
};

if($scope.data.esignature.e_sig_required && esigRequired) {
spUIActionsExecuter.executeFormAction(ESIGNATURE.REJECT_SYS, "sysapproval_approver" , id, [] , "", requestParams).then(function(response) {
});
} else {
spModal.prompt("Please enter reason for rejection").then(function(rejectReason) {
$scope.data.op = "rejected";
$scope.data.target = id;
$scope.data.comments = rejectReason;
get(); 
});
}
}

...

}

______________________________________________________________________________________

View solution in original post