- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-22-2018 06:43 PM
I want to include survey link in the incident closure notification.
I built a survey and enabled public access so that i can include the survey url in the incident closure email to take surveys.
This is the URL i need to include in the email:
Click here: https://dev56002.service-now.com/sp?id=public_survey&type_id=87186844d7211100158ba6859e610378
But i want the URL to be displayed as 'Take survey' so that it redirects to the above URL?
Can someone help me with writing the mail script?
The notification i am writing to include this survey link is written on incident table
I tried this mail script below:
var link = new AssessmentUtils().getAssessmentInstanceURL(current.sys_id);
var url = '<a href="' + link + '">here</a>';
template.print(url);
But when i clicked on the link it is displaying as invalid URL
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-22-2018 08:23 PM
Hello Nikitha
Try this
var link = new AssessmentUtils().getAssessmentInstanceURL(current.sys_id);
var url = '<a href="' +link + '">' + 'Please click here to take Survey' + '</a>';
template.print(url);
Please mark my response as correct and helpful if it helped solved your question.
-Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-28-2020 05:49 AM
you can write this in the email script:
var gr = new GlideRecord('asmt_assessment_instance');
gr.addQuery('trigger_id', current.sys_id);
gr.query();
if (gr.next()) {
var instance = gr.sys_id;
}
var record = current.sys_id;
var instancesurvey = gs.getProperty('glide.servlet.uri') + 'sp?id=take_survey&instance_id=' +instance;
template.print(instancesurvey);