Email notification should trigger when add comments changed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2024 06:33 AM
Hello Folks,
Good Day!
I was stucked with a requirement, when someone entered any value in the additional comments in catalog task i need send an email notification with the details what they have been entered.
Tried with Notifications and BR's can achieve this one..
I will desperately need someone to assist me in this issue..
Any assistance would be appreciated!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2024 06:51 AM
Hi @dmahendran
Yes you can achieve this by using Business Rules (BRs) and Email Notifications. Could you please share what you have did with us so we can help you accordingly or you can refer bellow steps:
- You need to create a Business Rule that will be triggered when someone enters or modifies a value in the Additional Comments field.
- Table -> sc_task (or your specific catalog task table)
- After Insert & Update
- Condition -> current.comments.changes() && current.comments != ''
Scirpt :
// Check if a comment has been added
if (current.comments.changes()) {
var gr = new GlideRecord('sys_email');
gr.initialize();
gr.type = 'send-ready'; // The email will be processed as a send-ready email
gr.subject = 'New Comment on Catalog Task';
gr.body = 'A new comment has been added: ' + current.comments;
gr.recipients = current.requested_for.email;
gr.insert(); // This will trigger the email to be sent
}
I hope my answer helps you to resolve your issue, if yes please mark my answer helpful and correct.
thank you
Rajesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2024 07:27 AM
@Rajesh Chopade1 Thanks for your response.
Still the issue persists, i cant able to get the value which i have been entered in the catalog task additional comments. Have attached my snip below.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2024 10:08 AM - edited 12-06-2024 10:18 AM
Hi @dmahendran ,
1)Create an Event in Event Registry.
Event Name: ctl.comments_sctask.notification
Table: sc_task
2)Create a Business Rule on table -sc_task
When: After insert
condition:
current.comments.changes() && current.comments != ''
Script : gs.eventQueue('ctl.comments_sctask.notification',current , current.comments);
}
3)Create new Email notification
Table: sc_task
When to send: Select “Event is fired.”
Who will receive : requested for
Event Name: ctl.comments_sctask.notificatioN
A new comment has been added to your catalog task: ${number}
Comment:
${event.param1}
Mark it as helpful and solution proposed if it serves your purpose.
Thanks,
Anand
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2024 12:42 AM
@Anand Kumar P Ty for your kind response!!
Still I'm not able to see the additional comments, also there were no email triggers when i update the additional comments.