Is it possible to use a user group as a reference qualifier?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-12-2022 01:51 PM
Greetings, everyone.
Long story shot: I have a few "Reference" fields, of which the reference is the "user" table, and I'm wondering if it would be possible to use user groups (not departments or companies) as the reference qualifiers of these "Reference" fields.
Any help would be greatly appreciated!
- Labels:
-
Scripting and Coding
-
Studio
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-12-2022 01:59 PM
Look at the dictionary entry for "assigned to" on the task table. I think it does what you want.
https://YOUR_INSTANCE.service-now.com/nav_to.do?uri=sys_dictionary.do?sys_id=726739940a0a3c740101f7d959dc73cc%26sysparm_view=advanced
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-12-2022 02:10 PM
Here is a working example
Script Include
function isGroupMember() {
var grUser = new GlideRecord('sys_user_grmember');
grUser.addQuery('group', '<sys_id_of_your_group>');
grUser.query();
var userArray = [];
while(grUser.next()){
userArray.push(grUser.getValue('user'));
}
return 'sys_idIN' + userArray.join();
}
Reference Qualifier
