Add existing users to group through script
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-21-2022 02:18 PM
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
Labels:
- Labels:
-
Scripting and Coding
17 REPLIES 17

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-02-2022 11:02 PM
Exactly which field in which form is used to associate a user to CI?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-03-2022 12:02 PM
cmdb_ci_service table and field is owned_by (owned_by filed is referenced to user table)

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-03-2022 05:48 PM
Then use the following script.
var grCIUser = new GlideRecord('cmdb_ci_service ');
if (!grCIUser.get('owned_by', current.owned_by)) {
return;
}