- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-13-2022 02:59 AM
Hi
I have a requirement where I want to send notification for a change record. In the notification I want to display the Record Numbers in the Incidents Pending Change tab (where I can have maximum 3 records). I also want to display link, that will take me to the incidents.
How can I achieve this?
Thanking in Advance
AD
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-13-2022 03:33 AM
Hi,
so you have notification on change_request table and want to include the INC in the related list tab shown
you will require email script for this and show the links and include that email script in your notification body
(function runMailScript(current, template, email, email_action, event) {
// Add your code here
var gr = new GlideRecord('incident');
gr.addQuery('caused_by', current.sys_id);
gr.query();
if (gr.hasNext()) {
template.print("Incidents: <br />");
while (gr.next()) {
var url = gr.getTableName() + ".do?sys_id=" + gr.getValue('sys_id');
var attachLink = '<a href="' + url + '">' + gr.number + '</a>';
template.print(attachLink + "<br />");
}
template.print("<hr/>");
}
})(current, template, email, email_action, event);
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-13-2022 03:33 AM
Hi,
so you have notification on change_request table and want to include the INC in the related list tab shown
you will require email script for this and show the links and include that email script in your notification body
(function runMailScript(current, template, email, email_action, event) {
// Add your code here
var gr = new GlideRecord('incident');
gr.addQuery('caused_by', current.sys_id);
gr.query();
if (gr.hasNext()) {
template.print("Incidents: <br />");
while (gr.next()) {
var url = gr.getTableName() + ".do?sys_id=" + gr.getValue('sys_id');
var attachLink = '<a href="' + url + '">' + gr.number + '</a>';
template.print(attachLink + "<br />");
}
template.print("<hr/>");
}
})(current, template, email, email_action, event);
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-14-2022 11:03 PM
Hope you are doing good.
Did my reply answer your question?
If so, please mark appropriate response as correct & helpful so that the question will appear as resolved for others who may have a similar question in the future.
If not, please let us know if you need some more assistance.
Thanks!
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader