Hi, I want to add RITM number to my email notification on req table

rajeshKongamudi
Tera Contributor

Hi Community,

 

Can someone please help us how to add RITM number link on email notification which runs on request table in ServiceNow, that it should redirect to the RITM page on service portal. Please help us on this request thanks in advance.

 

1) This was the request Notification we need after request link RITM link needs to be added.

rajeshKongamudi_0-1709650554838.png

2) This was the email script for redirecting to the request service portal 

rajeshKongamudi_1-1709650654340.png

 

2 REPLIES 2

Community Alums
Not applicable

Hi @rajeshKongamudi ,

Here is a sample script :

(function runMailScript(current, template, email, email_action, event) {

var url='';
var gr = new GlideRecord('sc_req_item');
gr.addQuery('sys_id',current.request_item);
gr.query();
if(gr.next())
{
var sysid = gr.sys_id;

gs.log(sysid+ 'Get sysid');

template.print('<a href="enter your portal url sys_id='+sysid+'">' +gr.number+ '</a>');
}
}

)(current, template, email, email_action, event);

 

Hi @Community Alums ,

 

I used your code but no luck, but i made the changes from my side can you please look into it that where I'm making mistake. actually, RITM number should redirect to the (service portal) request which we have raised to

it since we are using request table(sc_request) on the notification whenever we are using current in email script it should refer to the RITM table when we call that particular script in body content there it is troubling the issue. following code which i have modified

rajeshKongamudi_0-1709660014123.pngrajeshKongamudi_1-1709660034318.pngrajeshKongamudi_2-1709660067914.pngrajeshKongamudi_3-1709660090218.png

But here it is showing empty RITM

rajeshKongamudi_4-1709660147224.png