- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-02-2022 06:38 AM
How to send mail to approver on ritm if any comment has been made in the ritm by the requestor
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-04-2022 03:50 AM
Hello Shalika,
I am not sure what will be the best approach to implement this requirement in your instance but you can do the following:
1. Create an event in sysevent_register table with Name as sc_req_item.commented.approver and Table as sc_req_item.
2. Create an after update BR on sc_req_item table with condition and script as shown below:
Script Condition: current.comments.changes() && gs.getUserID() == current.requested_for
(function executeRule(current, previous /*null when async*/ ) {
var lastComments = current.comments.getJournalEntry(1);
var approverList = [];
var sysApprovalGR = new GlideRecord("sysapproval_approver");
sysApprovalGR.addEncodedQuery("sysapproval=" + current.getUniqueValue() + "^state=requested");
sysApprovalGR.query();
while (sysApprovalGR.next()) {
approverList.push(sysApprovalGR.getValue("approver"));
}
if (approverList.length && lastComments) {
gs.eventQueue("sc_req_item.commented.approver", current, approverList, lastComments);
}
})(current, previous);
3. Create a notification on sc_req_item table with below details:
Subject: ${number} has been commented by ${requested_for}
in Message field you can put the below content:
You can make changes as per your requirement in email content.
Please mark my respsone as helpful/correct, if it answer your question.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-02-2022 07:36 AM
Flow Designer with these steps roughly
Flow Properties: Run on every update
TRIGGER: On update of sc_req_item where comments changes
1. Look up records: Approvers where approval task = trigger's sc_req_item
2. For each of (1)
3. Send Notification
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-04-2022 03:50 AM
Hello Shalika,
I am not sure what will be the best approach to implement this requirement in your instance but you can do the following:
1. Create an event in sysevent_register table with Name as sc_req_item.commented.approver and Table as sc_req_item.
2. Create an after update BR on sc_req_item table with condition and script as shown below:
Script Condition: current.comments.changes() && gs.getUserID() == current.requested_for
(function executeRule(current, previous /*null when async*/ ) {
var lastComments = current.comments.getJournalEntry(1);
var approverList = [];
var sysApprovalGR = new GlideRecord("sysapproval_approver");
sysApprovalGR.addEncodedQuery("sysapproval=" + current.getUniqueValue() + "^state=requested");
sysApprovalGR.query();
while (sysApprovalGR.next()) {
approverList.push(sysApprovalGR.getValue("approver"));
}
if (approverList.length && lastComments) {
gs.eventQueue("sc_req_item.commented.approver", current, approverList, lastComments);
}
})(current, previous);
3. Create a notification on sc_req_item table with below details:
Subject: ${number} has been commented by ${requested_for}
in Message field you can put the below content:
You can make changes as per your requirement in email content.
Please mark my respsone as helpful/correct, if it answer your question.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-11-2023 09:14 AM
I must say this was an excellent solution provided by @Mahendra RC