- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2023 09:47 AM
Hi All,
i would like to get List of groups (type = request) of user from requested for to a reference type field.
can someone help me with Script include and advanced reference qualifier.
Thanks in advance!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2023 08:32 AM
I would say this is the right way to do it on this request!!
--------------Script Include------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2023 11:01 AM - edited 10-17-2023 11:09 AM
Hello @Ram050670 ,
Your script include code is not correct. You are not returning correct query.
Please refer to the below code:-
getUserRequestGroups: function(userId) {
var groups = [];
var gr = new GlideRecord('sys_user_grmember');
gr.addQuery('user', userId);
gr.addQuery('group.type', 'request');
gr.query();
while (gr.next()) {
groups.push(gr.group.toString());
}
return 'sys_idIN'+groups;
},
Also, for Reference Qualifier your script is incorrect , refer to the below script:
If this response clears up your doubt, kindly flag it as both helpful and correct.
Thanks,
Alka
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2023 11:15 AM
@Alka_Chaudhary tried you script and qualifier but still its showing all groups
i am not sure whats wrong in it, tried different ways!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2023 11:52 AM
@Ram050670 Please replace you script include with my script and also reference qualifier then it will work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2023 11:17 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2023 11:23 AM