How to add the link of the incident in the email

nehas
Kilo Contributor

Hello community,

Coming to the work orders in Service portal. When the customers are emailed updates or notes or anything about the ticket it should have the ticket number and the link which leads to the particular incident.How should i proceed for this requirement.

Please share your ideas.

Thank you.

9 REPLIES 9

Community Alums
Not applicable

Take a look here, this should get you started:



Scripting for Email Notifications - ServiceNow Wiki



Cheers,



Tim


Community Alums
Not applicable

I should actually link to the 'docs' site, as wiki is going away:



Link to related records



Tim


Jaspal Singh
Mega Patron
Mega Patron

Hi Nagasri,



You can use something as Number: ${URI_REF} in the body of mail notification.


Hey,


My script is like this .Should i add Number: ${URI_REF} in the line template.print('</br><b>Number</b>: '+ current.number);?





(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,


/* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,


/* Optional GlideRecord */ event) {


//template.print('Hello,</br>');


template.print('<br/>Following are the ticket details<br/>');


template.print('</br><b>Number</b>: '+ current.number);


template.print('</br><b>Order Summary</b>: '+ current.short_description);


template.print('</br><b>Description</b>: '+ current.description);


template.print('</br><b> Asset/Location</b>: '+ current.asset_location);


if(current.asset_location == 'asset'){


template.print('</br><b>Asset</b>: '+ current.asset.getDisplayValue());


} else if(current.asset_location == 'location'){


template.print('</br><b>Location</b>: '+ current.u_site.getDisplayValue());


}




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