The CreatorCon Call for Content is officially open! Get started here.

Client Script is not working for all roles

Saib1
Tera Guru

Hi All,

I have the itil access when i select this Roles it gives "No Match Found" . 

Note : it is working perfectly for admin access. 

 

Saib1_2-1705273896963.png

 

I am getting another error as well when i select Roles

Saib1_0-1705275357590.png

 

Below is the Client Script written on Variable Set

 

Saib1_0-1705278099918.png

 

 

Client Script

*************

function onChange(control, oldValue, newValue, isLoading) {
  if (isLoading || newValue == '') {
      return;
   }
 
alert(newValue);
   var ga = new GlideAjax("CustomRoleOptionsUtils");
   ga.addParam("sysparm_name", "getRoles");
   ga.addParam("sysparm_env", newValue);
   ga.getXMLAnswer(populateRoles);
 
   function populateRoles(answer){
var roles = answer.split(",");
g_form.clearOptions("roles");
var len = roles.length;
for(var i=0; i < len; i++){
g_form.addOption("roles", roles[i], roles[i]);
 
}
   }
 
 
   
}
Script Include
**************
var CustomRoleOptionsUtils = Class.create();
CustomRoleOptionsUtils.prototype = Object.extendsObject(AbstractAjaxProcessor, {
getRoles: function(){
var env = this.getParameter('sysparm_env');
gs.print("Environment"+env);
var roles;
if(env == 'test'){
roles = gs.getProperty("custom.test_environment.roles");
} else if(env == 'beta'){
roles = gs.getProperty("custom.beta_environment.roles");
} else if(env == 'development'){
roles = gs.getProperty("custom.dev_environment.roles");
}
return roles;
},
type: 'CustomRoleOptionsUtils'
});
 
System Properties
******************
 
Saib1_0-1705275975608.png

 

Please help me

 

 

1 REPLY 1

Sainath N
Mega Sage

@Saib1 : All the client callable script includes are secured by ACL’s. Based on your explanation as it’s working for admins please check if there was an client callable script include ACL for this that’s blocking for other user.

 

please check for ACL’s of below type:

  • Type: client_callable_script_include
  • Add <Name of the Script Include to provide access> in Name,
  • Roles: To check

Please mark this as correct answer and helpful if it resolved, or mark this helpful if this help you to reach towards solution.