- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago - last edited 2 weeks ago
var grUser = new GlideRecord("sys_user_grmember");
grUser .addQuery("group", current.u_assignment_group);
grUser .addQuery('user', '!=', current.u_assigned_to);
grUser .query();
var querStr = '';
while (gr.next()) {
if (querStr == '') {
querStr = 'sys_idIN' + grUser .getValue('user');
} else {
querStr += ',' + grUser .getValue('user');
}
}
return querStr;
},
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a week ago
Hi @ishwarsingh
in your code you've started with "var grUser = new GlideRecord" and in your "while" loop you've inserted "while (gr.next()) {". This is not correct
May you try
var grUser = new GlideRecord("sys_user_grmember");
grUser.addQuery("group", current.u_assignment_group);
grUser.addQuery("user", "!=", current.u_assigned_to);
grUser.query();
var querStr = '';
while (grUser.next()) {
if (querStr == '') {
querStr = 'sys_idIN' + grUser.getValue('user');
} else {
querStr += ',' + grUser.getValue('user');
}
}
return querStr;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a week ago
Hi @ishwarsingh ,
For this you can refer the solution provided in this post by me Make Assignment group dynamic - ServiceNow Community.
This is just opposite of what you did for assignee based on assignment group. Actually you don't need script to show only assignee which are part of assignment group, because this is alaredy OOTB feature, you can confirm by checking the dictionary configuration of assigned_to in depedent field it should have 'assignment_group'. As screenshot provided by @Brian Lancaster .
Thanks,
Bhimashankar H
-------------------------------------------------------------------------------------------------
If my response points you in the right directions, please consider marking it as 'Helpful' & 'Correct'. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a week ago
Hey @ishwarsingh ,
Did you get a chance to review my reply for your latest question here.
If my response points you in the right directions, please consider marking it as 'Helpful' & 'Correct'. It will help future readers as well having similar kind of questions and close the thread.
Thanks,
Bhimashankar H