non-admin try to Add group
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago
Hi Team
To add a a group in a specific user i'm using this script. Is not a beauty code, but work
var users = current.variables.select_the_user.toString().split(",");
var arrayGrupo = current.variables.group_associate.toString().split(",");
users.forEach(function(userSysId) {
arrayGrupo.forEach(function(grupoSysId) {
var groupName = utils.getGroupName(grupoSysId);
addUserGroupWithId(userSysId, grupoSysId);
});
});
function addUserGroupWithId(userID, groupID) {
var userGroupGR = new GlideRecord('sys_user_grmember');
userGroupGR.initialize();
userGroupGR.user = userID;
userGroupGR.group = groupID;
userGroupGR.insert();
},
i've applicated in a business rule to trigger when a non-admin try to add an user a specific group
besides not work i'm facing this issue in the log.
Add user in group(56c2540c470cf610cbcc97a4116d4384): ReferenceError: "item" is not defined. (#0(eval); line 97)
With Admin works normally, i checked:
ACL,
Business Rule,
Script Include,
UI and DATA polices
Client Script... everything, bot not found
if anybody got the same problem i would like to hear you.
Thank's advance
0 REPLIES 0