In sn_grc_issue form there is control/risk variable as reference field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
In sn_grc_issue form there is control/risk variable as reference field. The ask is to filter the data irrespective of the Data and IT governance group members to view their respective frameworks details . The framework is listed from the risk statement table. How can this be achieved?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
35m ago - last edited 35m ago
Hi @chinagudish
You can do this with an advanced reference qualifier backed by a script include. The script reads the user's groups, gets the frameworks they are allowed, and returns a query.
The code is:
var GRCFrameworkFilter = Class.create();
GRCFrameworkFilter.prototype = {
initialize: function() {},
getQuery: function() {
var frameworks = [];
var gm = new GlideRecord('sys_user_grmember');
gm.addQuery('user', gs.getUserID());
gm.query();
while (gm.next()) {
var fw = gm.group.u_framework.toString();
if (fw && frameworks.indexOf(fw) < 0)
frameworks.push(fw);
}
if (!frameworks.length)
return 'sys_idISEMPTY';
return 'framework IN ' + frameworks.join(',');
},
type: 'GRCFrameworkFilter'
};
On the dictionary entry set the reference qualifier to advanced and call `new GRCFrameworkFilter().getQuery()` from it.
Swap `u_framework` and `framework` for whatever your instance uses, as those field names depend on how you have mapped groups to frameworks.
Keep in mind this only limits the picker. It won't stop someone opening a record directly or seeing it in a list, so if the split has to be enforced you will need ACLs as well.
Reference qualifier types explained here:
Thanks
