ITSM approval notifications best practice?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
Hi I'm trying to manage our approval email notifications appropriately and am running into questions and not sure how to proceed.
In this case, we have 2 different approval notifications being sent out to approvers when an approval is inserted:
Notification [sysevent_email_action] | Triggered by | Email preview | Notes |
Requested item approval assigned | Notification 'When to send' State | Changes to | Requested Approval for.Task type | is | Requested Item |
| Inactive OOB, set to Active in our instance |
Approval Request | Event is fired - approval.inserted |
| Active OOB |
The first notification above (Requested item approval assigned) is only triggered when the approval's target record is a Requested Item. The second notification above (Approval Request) is triggered by an event that can also be triggered by Requests, Catalog Tasks, and Change Requests. Unlike the first notification, the second notification is much more detailed.
We have users who much prefer the first email - it looks better, it is more detailed, and many of our approvers are just department managers who do not have itil or approver_user roles, so they are unable to view the RITM they are approving in Platform/ESC UI (and they probably don't want to - they just want to approve through email).
Because of this, we want to keep RITM approval notifications limited to the first notification. The problem is that the second notification (Approval Request) is triggered by a Business Rule on sysapproval_approver that is also used to send approval notifications for the other task-types I mentioned above. Because it is a high risk file, I really don't want to edit the following conditions to exclude RITMs from triggering this notification, and I don't want to set it to inactive entirely, because then the other task-types I mentioned will not generate approval notifications and I'll have to create custom notifications for each of those task-types.
Business Rule that controls the second approval notification trigger:
Approval Events (Task) - I excluded most of it, just focusing on the part that controls the event trigger
function checkRequest() {
var task = current.sysapproval.sys_class_name || current.source_table;
return (task == 'sc_request');
}
function checkSCTask() {
var task = current.sysapproval.sys_class_name || current.source_table;
return (task == 'sc_task');
}
function checkStdChange() {
var task = current.sysapproval.sys_class_name || current.source_table;
return (task == 'std_change_proposal');
}
function isFlowDesigner(me) {
if (!me.wf_activity.nil())
return false;
if (!me.group.nil() && (me.group.wait_for == "process_flow"))
return true;
var listenerGr = new GlideRecord('sys_flow_listener');
var qc1 = listenerGr.addQuery('listening_to', me.sysapproval);
qc1.addOrCondition('listening_to', me.document_id);
listenerGr.addQuery('source_table', getSourceTable(me));
listenerGr.addQuery('name', 'Ask For Approval');
listenerGr.addQuery('state', 'WAITING');
listenerGr.query();
return listenerGr.hasNext();
}
var isRequest = checkRequest();
var isSCTask = checkSCTask();
var isStdChange = checkStdChange();
var isFD = isFlowDesigner(current);
var approvalCommentsUtil = new ApprovalCommentsUtil();
var approvalComment = approvalCommentsUtil.getApprovalComment(current, isFD);
var mayBeSystem = approvalCommentsUtil.canAddCommentAsSystem(current) == true ? 'system' : null;
if (current.state.changes() && current.state=='requested') {
var event = "approval.inserted";
if (isRequest)
event = "request.approval.inserted";
else if (isSCTask)
event = "sc_task.approval.inserted";
else if (isStdChange)
event = "std_change_proposal.approval.inserted";
gs.eventQueue(event, current, gs.getUserID(), gs.getUserName());
updateTask(current, approvalComment);
}
I'm wondering if anyone has ideas on the best way to proceed. We want to use the detailed/better looking Next Experience themed notification, but don't want to accidentally ruin OOB notifications for other task types.
Thanks