Sending survey link in notifications: need help

Nowlearner
Kilo Guru

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

 

1 ACCEPTED SOLUTION

Prateek kumar
Mega Sage

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

View solution in original post

10 REPLIES 10

Community Alums
Not applicable

Hi @NOWlearner , did your issue got solved. I am also facing the same issue. Invalid URL message. Kindly help to sort that.

Regards,

Sirraj

Hi Jace,

 

    I tried with second one but it's invalid

 

 

Prateek kumar
Mega Sage

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

Hi Prateek,

This is not working.

Still redirecting to the same invalid URL. I think this is because i am writing this mail script in notification written on incident table.

How can i embed my survey link URL into some other name?

I created scheduled job, event and notification..in email script I have written above code. When executed the hyperlink is taking to one sysid for all the record which is invalid.