You are not authorized to take this survey error.

Alok21
Giga Expert

Hi Team,

We have a functionality where once the case is closed, a survey email is send to the customer to fill in the survey. The issue we are facing is when customer click on the survey link he is getting error "You are not authorized to take this survey".

In the email field of user record i updated my gmail to check the root cause and below are the findings.

When i click the survey link, getting above error. When i login with my gmail id and then go to my inbox and click the survey, it is working as expected. The problem here is SSO login is not happening. 

Can someone assist on this issue?

Regards,

Alok sahu

 

4 REPLIES 4

AbhishekGardade
Giga Sage

Hello Alok,

your are giving trigger condition as caller is some name then only that person can take the survey,

if you want to check the survey you need to impersonate as a caller and refresh the link ,survey will get visible.

Please mark as Correct Answer and Helpful, if applicable.
Thanks!
Abhishek Gardade
Hexaware Technologies

Thank you,
Abhishek Gardade

Hi Abhishek,

Yes, when i impersonate with the caller and click the survey link it is taking me to the correct page. The issue is when customer receives the survey mail, he is not going to login and then click the link. Ideally once he click the survey link, SSO login should happen and he should be able to access the page.

 

Regards,

Alok sahu

Alok21
Giga Expert

Hi,

The error i am getting is from the OOTB UI Page (assessment_take2). In the HTML part, it is not getting the instance id and returning "not_authorized".

<g:evaluate jelly="true" var="jvar_assessable_sysid" copyToPhase2="true">
var asmtInstanceId = '';
if(typeof jelly.sysparm_assessable_sysid !== 'undefined'){
asmtInstanceId = SNC.GlideHTMLSanitizer.sanitize(jelly.sysparm_assessable_sysid);
var asmtInstanceRegex = new RegExp("^\\w+$");
if(!asmtInstanceRegex.test(asmtInstanceId)){
asmtInstanceId = 'invalidsysid';
}
}
if (asmtInstanceId == '') {
var instance = new SNC.AssessmentCreation().createOrGetAssessmentWithTrigger(jelly.jvar_assessable_type, '', gs.getUserID(), jelly.jvar_triggerTable, jelly.jvar_triggerId);
} else if(asmtInstanceId =='invalidsysid'){
instance = 'invalidsysid';
}else{
var temp = new SNC.AssessmentCreation().checkAssessmentAllowed(jelly.jvar_assessable_type, asmtInstanceId, gs.getUserID());
if (jelly.sysparm_isSurveyCreator == 'yes' || (jelly.jvar_isReaderView == 'true' ${AND} (gs.hasRole('survey_admin,survey_reader,survey_creator'))) || (jelly.jvar_assessment_type_class == 'change_risk_asmt' ${AND} gs.hasRole('itil,sn_change_read')))
var instance = asmtInstanceId;
else if (temp != "" ${AND} temp != "wip")
var instance = temp;
else
var instance = asmtInstanceId;
}
if (instance.substring(0, 6) == 'notyet') {
var when = instance.substring(6);
instance = 'notyet';
}
instance;
</g:evaluate>

 

Can someone advise on how to fix this issue?

Regards,

Alok sahu

 

hi ,

 Can you check the following. 

1. If the user/Contact is having internal role ,please  click on my assessment and surveys (see if you get error).

2.If its external user , please login to portal and click on my surveys..(see if you get error )

3.As you are taking the survey  via email  ,please click on the link and copy the url and  paste in on new browser..,,this is to make sure ...you are passing the right survey url.

 

Thanks

Luxo