Survey URL is redirecting to csm_login page instead of survey portal page


User tried to reach user survey URL by clicking the link from the received email and it is getting redirected to csm_login page instead of survey page.


  1. 1.Validate the survey URL received over the email, check if it is going via public page which is public_survey or not.
    • Non-problematic survey URL: /portal_est?id=public_survey&instance_id=b6f744dc1bcf1418f3944226cc4bcb46
    • Problematic survey URL: /
  2. Validate does the public_survey is set to public or not.
  3. Validate the  status of system property "sn_portal_surveys.sp_survey.email_redirection".
    • When Yes is selected, a survey accessed from a link in an email opens in the Service Portal.


Script include which is responsible to return the survey URL is returned incorrect survey URL based on the script conditions.

Script include - AssessmentUtils has a function - getAssessmentInstanceURL is responsible to populate the URL.

// Survey Instance Table URL
getAssessmentInstanceURL: function( /* String */ instance) {
  var gr = new GlideRecord("asmt_assessment_instance");
  var type = '';
  if (gr.get(instance)) {
    var asmtRec = new GlideRecord("asmt_metric_type");
    asmtRec.addQuery("sys_id", gr.getValue("metric_type"));
    if (
      type = asmtRec.getValue("sys_id");
  var instanceURL = gs.getProperty("glide.servlet.uri");
  var overrideURL = gs.getProperty("");
  var url = "";
  if (this.redirectToPortal() == 'true') {
    if (asmtRec.allow_public)
      url = instanceURL + this.defaultServicePortal + '?id=public_survey&instance_id=' + instance;
      url = instanceURL + this.defaultServicePortal + '?id=take_survey&instance_id=' + instance;
  } else {
    if (overrideURL)
      instanceURL = overrideURL;
      instanceURL = instanceURL + "";
    url = instanceURL + '?' + type + '%26sysparm_assessable_sysid=' + instance;

  return url;

The AssessmentUtils script include has two if conditions, if none of the portal is set to default true then it will go to else statement and return the URL which always requires login.

url = instanceURL + '?' + type + '%26sysparm_assessable_sysid=' + instance;

In order to overcome this issue validate the system property "sn_portal_surveys.sp_survey.email_redirection" it should be set to true and validate the "sp_portal", one of the portals should be set to default under the sp_portal.list.