Can someone help me how to add RITM links in the notification email script

NagaNandini N
Tera Guru

Hi All,

 

Can someone help me how to add RITM links in the notification email script? I have added the below code but instead of a URL link, the URL is getting printed on the mail. 

 

(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
          /* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
          /* Optional GlideRecord */ event) {

          // Add your code here

var url = 'a href="' + gs.getProperty('instance_name')+".service-now.com/sp?id=ticket&table=sc_req_item&sys_id="+current.sys_id+"&view=sp"+'">Click here to go to RITM</a>';
template.print(url);

})(current, template, email, email_action, event);
 
 
Please find the screenshot for reference.
 
1 ACCEPTED SOLUTION

Hi Dipen ,

 

The link works now but I need to add the RITM number and I have tried adding it like this. Please find the screenshot for your reference

 

Below is the working code and I need to add RITM number in the view. Please help me on this.

 

var url = '<a href="' + gs.getProperty('glide.servlet.uri') + 'sp?id=ticket&table=sc_req_item&sys_id='+current.sys_id + '">' + '<b> Take me to the RITM Service Portal View: current.request_item.number </b>' + '</a>';
template.print(url);

View solution in original post

14 REPLIES 14

@NagaNandini N 

Can u share some snips please for notification n email script

 

Thanks,

Danish

Hi @Danish,

 

PFA for your reference.

 

Regards,

Nandini N

Hi @NagaNandini N ,

 

Can u try this updated links plz n check, One of them should definetly work.

 

 

var link = "<a href =" + gs.getProperty('glide.servlet.uri') + "sp?sys_id="+current.sys_id+"&view=sp&id=form&table=sc_req_item>Click Here</a>";

var link = "<a href =" + gs.getProperty('glide.servlet.uri') + "sp?id=ticket&table=sc_req_item&sys_id="+current.sys_id+"&view=sp>Click Here</a>";

 

Mark my answer as helpful & accepted if it helps.

 

Thanks,

Danish

Hi Danish,

 

Both the scripts are not working 😞

 

Regards,

Nandini N

@NagaNandini N ,

 

Possible for u to share snip of 1 record by opening it in service portal. Once u open it can u share the url with me. hide the instance name rest u can share

 

Thanks,

Danish