For non-admin user script include return incorrect result in highlighted value condition

MarotiR
Tera Contributor

Hi Everyone,
I have a Script Include that returns one of the group members, and it is being used in a Dynamic Filter. This Dynamic Filter is further used as an “is dynamic” condition for a highlighted value in another module that belongs to a different application scope.
Script include Name: PMI_DEL_sMTGroupUtils

var PMI_DEL_sMTGroupUtils = Class.create();
PMI_DEL_sMTGroupUtils.prototype = {
    initialize: function() {},
    getSMTMembers: function() {
        var users = [];
        // Fetch system property using GlideRecord and pass the "SMT" group sys_id.
        var propGR = new GlideRecord('sys_properties');
        var smtGroupId = '';
        if (propGR.get('name', 'pmi_del.smt_group_id')) {
            smtGroupId = propGR.getValue('value');
        }
        // Query group members
        var gr = new GlideRecord('sys_user_grmember');
        gr.addQuery('group', smtGroupId);
        gr.query();
        while (gr.next()) {
            users.push(gr.getValue('user'));
        }
        return users;
    },
 
Screenshot of above Script include:
MarotiR_0-1778054564334.png

 


    type: 'PMI_DEL_sMTGroupUtils'
};
 
calling above script include in below dynamic filter option : 

MarotiR_1-1778054618905.png

 

Highlight value condition in which added above dynamic filter option:

MarotiR_2-1778054872427.png

 

The Script Include is created in the Global scope and is accessible from all application scopes. The issue is that when an admin user is logged in, the condition correctly returns all SMT group members.

However, when a non-admin user logs in, the result returns an empty groups members instead of the expected SMT group members. This behavior is incorrect, as non-admin users should also be able to retrieve the SMT group members please suggest the solution to get all SMT group member  for non-admin "Itil" user.

1 REPLY 1

Mark Manders
Giga Patron

My PDI is asleep, so I can't check, but if you are returning a list of sysIDs and then say caller is dynamic that list of sysIDs, you don't get anything. Shouldn't that condition be 'caller is one of isSMT'?


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark