How to configure the email script for RITM portal link on notifications

raj99918
Tera Contributor

Hi Team,

 

How to configure the email script for RITM portal link on notifications ?

 I have developed the email script its giving the correct RITM portal link but hyperlink just showing as RITM instead of RITM09107309 something like that below is my script and screenshot for the same.

 

(function runMailScript(current, template, email, email_action, event) {
    var url = '<a href="' + gs.getProperty('glide.servlet.uri') + 'esc?id=ticket&table=sc_req_item&sys_id=' + current.request_item + '">RITM</a>';
    template.print(url);
})(current, template, email, email_action, event);
 
ssa.jpg


1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@raj99918 

your notification is on sc_task?

If yes then do this

(function runMailScript(current, template, email, email_action, event) {
        var url = '<a href="' + gs.getProperty('glide.servlet.uri') + 'esc?id=ticket&table=sc_req_item&sys_id=' + current.request_item + '">' + current.request_item.number + '</a>';
        template.print(url);

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

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

3 REPLIES 3

Hristo Ivanov
Kilo Sage

Hey Raj,

 

Try this:

(function runMailScript(current, template, email, email_action, event) {
    var url = '<a href="' + gs.getProperty('glide.servlet.uri') + 
              'esc?id=ticket&table=sc_req_item&sys_id=' + current.request_item + '">' + 
              current.getDisplayValue('request_item') + '</a>';
    template.print(url);
})(current, template, email, email_action, event);

 

Please mark my response as correct and helpful, so others can benefit too

Ankur Bawiskar
Tera Patron
Tera Patron

@raj99918 

your notification is on sc_task?

If yes then do this

(function runMailScript(current, template, email, email_action, event) {
        var url = '<a href="' + gs.getProperty('glide.servlet.uri') + 'esc?id=ticket&table=sc_req_item&sys_id=' + current.request_item + '">' + current.request_item.number + '</a>';
        template.print(url);

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

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Perfect Thanks Sir