SNC_Internal role not working for sc_cat_item when used in script include
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2023 01:23 AM
I have created script include on sc_cat_item table to get "Item Owner".
and this is working fine with admin but when I tested with snc_internal role I am unable to get Item Owner.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2023 02:14 AM
Hi @Jagadish Sanadi
To fully help you, please state your business requirement, and share the script you used.
First guess on the info provided, is that ACL is restricting a snc_internal user to lookup users. So, please check the ACL's on the sys_user table to make sure snc_internal has appropriate access.
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2023 02:32 AM
Please ignore name of script include:
Client Script:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var ritm = new GlideAjax('WorkflowAJAX');
ritm.addParam('sysparm_name', 'getOwner');
// ritm.addParam('sysparm_cat_item', g_form.getValue('myservices_catalog_item'));
ritm.addParam('sysparm_cat_item', newValue);
// ritm.addParam('sysparm_item_id', itemSysId);
ritm.getXML(resultRITM);
}
function resultRITM(response) {
var answer = response.responseXML.documentElement.getAttribute("answer");
g_form.setValue('hv_owner', answer);
var owner = g_form.getValue('hv_owner');
var req = g_form.getValue('requested_for');
if (req != owner) {
g_form.setValue('check_owner', true);
}
}
script Include:
var WorkflowAJAX = Class.create();
GetWorkflowAJAX.prototype = Object.extendsObject(AbstractAjaxProcessor, {
getWorkFlow: function() {
var ci = this.getParameter('sysparm_cat_item');
var gr = new GlideRecord('sc_cat_item');
gr.addQuery('sys_id', ci);
gr.query();
if (gr.next()) {
var workflow = String(gr.workflow.name);
return workflow;
// Return a string "false" instead of a boolean false
}
},
getOwner: function() {
var ci = this.getParameter('sysparm_cat_item');
var gr = new GlideRecord('sc_cat_item_subscribe_mtom');
gr.addQuery('sys_id', ci);
gr.query();
if (gr.next()) {
var owner = String(gr.u_item_owner);
return owner;
}
},
type: 'WorkflowAJAX'
});

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2023 02:41 AM
Did you store the owner of the item on the sc_cat_item_subscribe_mtom table or on the sc_cat_item table?
If the last is the case, you need to dotwalk to the catalog item in your getOwner function to get to the owner.
Otherwise, please check the ACL's, because I still think the problem lies there.
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2023 03:21 AM
I am doing sc_cat_item, yes it is ACL issue. what role do I need to add along with SNC_External to fix this issue?