- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2025 11:08 AM
Hi,
I am trying to create an email notification to be sent to the Assigned to of a SCTASK when an end user/opened by adds a new comment through the service portal. The issue we are facing is when a user adds a comment to the ticket (RITM) in the portal, we don't know unless we continually open the ticket and look.
Thanks,
Jonathan
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2025 11:57 AM - edited 04-03-2025 12:01 PM
Hello @Jonathan102 ,
Here is solution that will not only trigger a notification but also copy the user's comment to the Work notes of the SCTASK itself for better visibility.
Create a new Business Rule configured like this:
Put the following code into Advanced > Script, or adjust as desired.
(function executeRule(current, previous /*null when async*/ ) {
var grTasks = new GlideRecord('sc_task');
grTasks.addQuery('request_item', current.getUniqueValue());
grTasks.query();
while (grTasks.next()) {
grTasks.work_notes = 'Comment added to RITM: ' + current.comments.getJournalEntry(1);
grTasks.update();
}
})(current, previous);
This will trigger the OOTB "Catalog task worknoted" Notfications to the task Assignee or Assignment group.
I verified that this works fine in Service Portal.
Regards,
Robert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2025 07:16 AM
email script is added to notification i have miss to upload screenshot of that step configure as below in the notification in what it will contain body.
it will resolved your issue let me know once it is working as per your requirement.