Dynamic filter is not working when using system property in script include
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
Dynamic filter is not working when using system property in script include
Code:
var MembersOfStoreGHD = Class.create();
MembersOfStoreGHD.prototype = {
getGroupMembers: function() {
var strId = '';
var groups = gs.getProperty('store.ghd.groups');
var gr = new GlideRecord('sys_user_grmember');
gr.addQuery('group', 'IN', groups);
gr.query();
while (gr.next()) {
var userId = gr.getValue('user');
if (strId.indexOf(userId) == -1) {
strId += userId + ',';
}
}
gs.info('Dynamic Filter Return Ids => ' + strId);
return strId;
},
type: 'MembersOfStoreGHD'
};
And I have created the dynamic filter correctly.
Please suggest something because I have been restricted to use the sys id directly in code.
And I have created the dynamic filter correctly.
Please suggest something because I have been restricted to use the sys id directly in code.
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
Dynamic filters run in the script sandbox which disables access to certain capabilities, these are documented below
https://www.servicenow.com/docs/r/api-reference/scripts/script-sandbox.html
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
What should I do then?
