Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Email script help to open link record

kalava
Giga Contributor

Hello Community,

Can any one help below requirement.

I want to display the number in notification body through email script and if i click that number it should be open form view same record and i dont want to open in service portal.

anyone help me with the script it's highly appreciated.

Thanks,

Ramesh kalava

1 ACCEPTED SOLUTION

asifnoor
Kilo Patron

Hi

In your script you can do simply like this

var attachLink = '<a href="/incident.do?sys_id='+current.sys_id+'">' + current.number + '</a>'; //put your table name

template.print(attachLink);

View solution in original post

26 REPLIES 26

It's displaying 0 value in body instead of number

It'll depend on the record you're trying to set up a notification for. If it has no number field then it will likely display 0 (i.e null).

 

this record having the number kieran

Can you provide more information on what you're trying to achieve? Screenshots etc.

Hi Kalava,

Could you try below script 

var instance_name = gs.getProperty('instance_name');
var table= current.getTableName();
var url = "https://"+instance_name+".service-now.com/nav_to.do?uri="+table+".do?sys_id="+current.sys_id;

template.print(url);

 

If I have answered your question, please mark my response as correct and/or helpful.

Thanks,

Suseela P.