insert work notes into email notification
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2023 09:20 PM
Here is my scenario.
Scenario
I have 4 TASK ticket created.
1. TASK 1 ticket open to Team A and state set as Close Complete.
2. TASK 2 ticket open to Team B and state set as Close Complete.
3. TASK 3 ticket open to Team A and before state set as Close Incomplete, Team A must put work notes comment TASK 3 ticket.
4. Team B receive email notification including Work Notes comment from Team A when TASK 2 ticket reopen.
5. Team B before set state as Close Complete, Team B must put work notes comment TASK 2 ticket.
6. Team A receive email notification including Work Notes comment from Team B when TASK 3 ticket reopen.
7. Team B set state as Close Complete for TASK 3 ticket.
8. TASK 4 ticket open to Team B and state set as Close Complete.
I would like to get your solution or idea how to implement work notes comment insert to email notification.
Thank You

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2023 09:46 PM
Hello @TMKAM
Capturing any work notes or comments from a task record is pretty simple.
When you design the notification, under the What it will contain section you will have the fields of the form.
You can simply add the Additional Comments and the Work Notes of the field.
Am assuming that you should be having some relation between the tasks here.
Now, for point 4, there should be some reference field on Task 2 where you should capture Team B details.
Once that is done, you should be able to configure a simple email notification.
Similarly for point 6.
- Therefore looking at this, the task form should be having 2 reference field, to the sys_user_group table.
- Lets say Field 1 is for the original assignment group for the task, and Field 2 is the group that needs to be notified.
- When setting the email notification, under the Who will receive section, selec the Users/Groups in fields field, and add Field 2 here.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2023 10:16 PM
Dear SatyakiBose,
Thank you for your solution and below are the configuration and below are my test result
1. Task 1 open to Team A and close complete.
2. Task 2 open to Team B and close complete.
3. Task 3 open to Team A and add work notes and set as close incomplete
4. Email send to Team B and Task 2 reopen but no work notes information in the email from Team A.
Email notification configuration
Email receive from Team B to Team A with Task 2 ticket but no work notes information in the email content.
I hope the above email configuration is correct.
Regards,
TMKam

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2023 02:04 AM
Hello @TMKAM
Write a notification script as below:
(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */ event) {
template.print('<br/>');
template.print('<font size="3" color="#000000" face="arial">');
template.print('<b>Work Notes:</b><br/><br/>');
template.print(current.work_notes.getJournalEntry(-1));
template.print('</font>');
})(current, template, email, email_action, event);
A value of -1 includes all journal entries for the work notes field.
You can change it to value such as '1', which will include only the latest work notes.
Add this notification script in the email notification body content and see how it works.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2023 05:38 PM
Dear SatyakiBose,
Thank you for the scripts but im a bit noob here where im not sure what should I fill on the below scripts.
"(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template, /* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action, /* Optional GlideRecord */ event) {"
Could you guide me? Thank you
REgards,
TMKam