Add a custom message to the reject popup
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-28-2025 03:14 AM
How can I add a custom message to the reject popup in an approval task on the ServiceNow portal when the Reject button is clicked?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-28-2025 03:57 AM
1. Go to sys_ui_message table.
2. Create an entry with key as "Provide a reason for rejecting this request".
3. In the message field give your custom message and save.
Raghav
MVP 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-28-2025 03:58 AM
Hi @Pavan rishi ,
Please clone OOB approval widget SC Approvals or My Approvals. Clone it. Inside your widget’s Client Script, find the part that runs when Reject is clicked.
Replace it with something like this:
$scope.reject = function() {
$uibModal.open({
template: `
<div class="modal-header"><h3>Reject Task</h3></div>
<div class="modal-body">
<p>Please enter a reason for rejection:</p>
<textarea ng-model="data.reason" class="form-control"></textarea>
</div>
<div class="modal-footer">
<button class="btn btn-default" ng-click="$dismiss()">Cancel</button>
<button class="btn btn-danger" ng-click="$close(data.reason)">Reject</button>
</div>
`,
controller: function($scope) {
$scope.data = { reason: '' };
}
}).result.then(function(reason) {
// Save the reason and update the task
$scope.data.reason = reason;
$scope.data.state = 'rejected';
$scope.server.update(); // This sends it to the backend
});
};