- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2025 01:59 PM
need to update the existed form ticket variable earlier it one of the variable type is refrence later it got update to single select as the result the value of the variable change to sys_id.
So now the task is to convert the sys_id into name. it only working for admin not for the normal user
here are the script
Client script :
Script include : test4
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2025 10:49 AM
Hi @singhr14 ,
The user you are trying fetch the info for is that account inactive?
OOB there is Query BR on the sys_user table which only shows active records for normal users
check below post of mine
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2025 06:22 AM
Hi @folusho,
Thank you for your response BUT still it's not working for "snc_internal" / itil role user.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2025 07:25 AM
Can you please be more specific with the error?
At what point is it not working for non-admins?
Can you do the following:
1. Put the following alerts in the client script and get the result for both admin and non-admin:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2025 07:54 PM
Hi @singhr14
Since you mentioned that it's working fine for admins but not for others, it seems to be an ACL issue. When creating a new client-callable script include, you were prompted to provide a role so that users with that role can access the script include. It appears you provided the admin role, which is why it's working only for admins and not for others. To resolve this, go to the script include, open the ACL from the "Access Control" related list, and update the roles to 'snc_internal'.
Regards,
Siva
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2025 06:23 AM
Hi @J Siva
Yeah i have update the script include role "snc_internal" but still its not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2025 06:29 AM
try this once
Did you add logs and see if script include is getting called or not?
I added this line just before query -> gr.setWorkflow(false);
var test4 = Class.create();
test4.prototype = Object.extendsObject(AbstractAjaxProcessor, {
fieldValues: function(){
var gmName = this.getParameter('sysparm_agname');
var gr = new GlideRecord('sys_user');
gr.addQuery('sys_id',gmName);
gr.addEncodedQuery('sys_id='+ gmName);
gr.setWorkflow(false);
gr.query();
if(gr.next()){
var json = new JSON();
var object= {
"genericmName": gr.getValue('name')
};
var data = json.encode(object);
return data;
}
},
type: 'test4'
});
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader