show the groups only where the requested by is a part of
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-23-2022 10:35 AM
Hey, i have a reference field which i have to populate with the groups for which the "requested by" is a part of "only". Help please.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-23-2022 10:44 AM
Demo:-
Reference Qualifier :-
Script Include :-
Please Mark My Response as Correct/Helpful based on Impact
Regards,
Gunjan Kiratkar
2X ServiceNow MVP
Community Rising Star 2022
Youtube : ServiceNow Guy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-23-2022 10:56 AM
hey one last doubt how will it proide the requested bys groups only here like where is it referred
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-23-2022 11:01 AM
Oh i'm sorry,
Make changes as below: if you are using it in catalog then use "current.variables.requestedForVariableName", if not for catalog then "current.requestedForFieldName"
Script Include :-
var getAjax = Class.create();
getAjax.prototype = Object.extendsObject(AbstractAjaxProcessor, {
getGroups: function(getReq) {
var groupArr = [];
var uID = getReq;
var grmember = new GlideRecord('sys_user_grmember');
grmember.addQuery('user', uID);
grmember.addQuery('group.active', true);
grmember.query();
while (grmember.next()) {
groupArr.push(grmember.group.toString());
}
return 'sys_idIN' + ret;
},
type: 'getAjax'
});
Please Mark My Response as Correct/Helpful based on Impact
Regards,
Gunjan Kiratkar
2X ServiceNow MVP
Community Rising Star 2022
Youtube : ServiceNow Guy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-23-2022 11:03 AM
Thanks tons'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-29-2022 06:44 AM
hey i am trying it is not working though i am checking it.