Survey URL issue

GMoon
Tera Guru

Hi all,

 

We have begun testing our surveys and have run into a snag. The snag being that when a user clicks the survey url within the email, it does not route to that specific ticket survey. It is going to a survey but not the one pertinent to their ticket. Our config is as follows:

Ticket is resolved, email notification is sent. Within the email notification we have a mail script containing the url to the survey, obtained from the 'View survey URL' related list. 

 

Does anyone know where the issue lies? Thanks!

1 ACCEPTED SOLUTION

Hi @GMoon in that case create a new email script with below code and call this script in your notification. I assume your notification is on assessment_instance table.

Script:

  //esc = portal URL

var url = 'esc?id=take_survey&instance_id=';
var link = '<a href="'+ gs.getProperty('glide.servlet.uri') + url + current.sys_id + '">' + 'Click here to start the survey' +  '</a>';
template.print(link);
Regards
Harish

View solution in original post

12 REPLIES 12

Hi @GMoon surveys are trigerred from assessment table, if you place your survey on incident or req item table, it will give invalid url because surveys might not be created yet

Regards
Harish

AJAYKUMAR G
Tera Contributor

You need write mail like below with using of script include name.

var html = new AssessmentUtils().getInstanceLinkHTML(current);
if(!current.metric_type.sample_metric)
    //template.print('<p> click here </p>');
template.print(html);

What do you mean by "with using of script include name." ?