- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-11-2017 12:40 AM
Can anyone from SNOW please confirm, that GlideLDAPGroups.setMembers() ignores the setting "Run business rules" of caller transformation map?
We import our SNOW users and groups from LDAP. For that purpose we employ out-of-the-box SNOW solution: stock onAfter transform script on group transformation, that contains the following code:
//
// After a group has been inserted the line of code below will get
// all the users that belong to the group according to LDAP and
// put the users into this group. This is done by getting
// the value from the u_members field from the source record.
// If you do not want to put the users in the group then you
// can comment out or remove the line below. If you are using
// something other than Active Directory and user membership is
// not indicated via the 'member' attribute then you can add the
// following line to indicate what field should be used. This
// line would be added before the the call to addMembers.
//
ldapUtils.setMemberField('u_roleoccupant');
//
ldapUtils.addMembers(source, target);
ldapUtils is initialized in onStart transform script with an instance of LDAPUtils. The latter is located among stock Script Includes, and contains this relevant code snippet:
addMembers : function(source, target) {
var ge = source.getElement(this.members);
var geString = null;
if (ge && !ge.isNil()) {
this._log(ge.toString());
geString = ge.toString();
}
var group = new GlideLDAPGroups(target, geString);
group.setMembers();
},
Now, GlideLDAPGroups.setMembers() inserts records in sys_user_grmember.
We have a business rule deployed on that table, which functions reliably on manual group membership manipulations in SNOW.
Despite flag "Run business rules" is set on our LDAP groups import transformation map, this business rule does not run when group membership records are created by this transformation map calling GlideLDAPGroups.setMembers()
I presume it's a "feature" of GlideLDAPGroups.setMembers()and I ask SNOW insiders for confirmation.
Thanks in advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-24-2017 12:48 AM
Hi Oleksiy,
I got an answer in a related case with ServiceNow. Apparently GlideLDAPGroups.setMembers() is NOT triggering any BR on table Group Member [sys_user_grmember] if there are NO roles associated on the group in question. So it will work if memberships to groups with roles are added but not without.
Cheers, Johan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-11-2017 12:53 AM
Similar topic: LDAP group membership script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-21-2017 11:49 AM
Hi Oleksiy,
Curious if you ever received an answer from ServiceNow?
I have the exact same situation with a business rule not being triggered by GlideLDAPGroups.setMembers().
Thanks,
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-24-2017 12:37 AM
Hi John,
no answer (yet).
Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-24-2017 12:48 AM
Hi Oleksiy,
I got an answer in a related case with ServiceNow. Apparently GlideLDAPGroups.setMembers() is NOT triggering any BR on table Group Member [sys_user_grmember] if there are NO roles associated on the group in question. So it will work if memberships to groups with roles are added but not without.
Cheers, Johan