Add existing users to group through script

J_31
Kilo Sage

I want to add existing users to group and create a business rule to check if the user exist in the group if not add to the group

Please can someone help with script

17 REPLIES 17

Exactly which field in which form is used to associate a user to CI?

cmdb_ci_service table and field is owned_by (owned_by filed is referenced to user table)

Then use the following script.

var grCIUser = new GlideRecord('cmdb_ci_service ');
if (!grCIUser.get('owned_by', current.owned_by)) {
  return;
}