- 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 05:30 AM
Hello @Jonathan102 ,
Have you tried this, or are there any concerns with the suggested solution?
Regards,
Robert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2025 03:01 PM
Hi @Jonathan102 ,
please follow below process it is working as per your requirement and it is tested on my PDI
1. create event
2.create business rule
3. create Notification
4. create email script
1. create event
filter navigator->system policy->event->registry-> new
2,Business rule:
system definition->business rule->new
3. notification :
system notification->notifications
email script :
system notification->notification email script
Kindly mark my answer as helpful and accept solution if it helped you in anyway.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2025 05:05 AM
Thank you so much for the information. The issue I am seeing with it is the fact that we do not set the Assigned to field on the RITM, only on the SCTASK. Based on how I understand the above, the notification is reflecting the RITM table, correct?
Thanks,
Jonathan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2025 05:36 AM
Yes if you want for sctask then you have to replace ritm table with sc task table that's it it will work for sctask as well
Mark my answer correct if it help you anyway
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2025 05:57 AM
Thank you! I've tried this but it's not working. I am unsure how the email script is connected to the other items. I don't see anything in the script to link it.