- 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 10:56 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2023 11:00 AM
Hello @Ram050670
In the Reference qualifier don't use javascript: new
Use this-
If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.👍
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2023 11:02 AM - edited 10-17-2023 11:02 AM
hI @Ram050670;
Update your Reference Qualifier to :
javascript: new CatalogClientUtil().getUserRequestGroups(current.variables.requested_for.toString())
Don't put : put actual colon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2023 11:11 AM
tried this too! didn't work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2023 11:15 AM
@Ram050670,
Update your Script Include to return 'sys_idIN'+groups;
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;
},