Auto-update Group memberships

Diane22
Tera Guru

We have 3 groups which are used for a variety of purposes:  ITSM Group Managers, ITSM Service Owners and ITSM Leads and Executives.  The manual process presents an open door to inaccurate / incomplete updates.  It is also time consuming to check (run reports) to validate resource changes on both the Technical Services and the Groups.

 

The sources are:  ITSM Group Managers => Group form, Group Manager field

                              ITSM Leads and Executives and Service Owners => CSDM Technical Service form

                                          Executive, Lead and Service Owner bring 3 distinct fields on the service form

 

I'd like to only need to manually update the Group form and the Service form ... and automate the group members inside these three groups.  In an ideal world ... the members would both be added as well as removed.  Would also need to deal with the scenario where one user could be in several fields.  For example:

-  A group manager may manage more than one group

-  A group manager could possibly also be a Service Owner

-  A service lead could possibly also be a service owner

-  An executive could also (but rarely) be a Lead

 

I'd imagine this may be possible using the sysID from these 3 fields but am not sure; nor am I sure as to the best approach do to this.

2 REPLIES 2

johnfeist
Mega Sage
Mega Sage

Hi Diane22,

If I'm understanding you correctly, what you want is to be able to have as an input that a person should be part of one of those groups.  If that's the case, you need to have a pretty simple script that has the user's sys_id and group's sys_id.  From there, you need to add a row to the table sys_user_grmember (table is the one that maps users to groups).  If you have both fields available on the form as references, you already have those values.

 

If I've missed something please let me know.

Hope that helps.

:{)

Helpful and Correct tags are appreciated and help others to find information faster

Not quite.  I'd like the values (user / member) to be pulled from the Technical Service form fields and Group Form field (input), as the value get modified operationally to have the group membership auto-update from the modification (add / remove).  Make sense?

ie:  Joe is removed from group A as a group manager on the group form and replaced by Pete

      Is Joe a group manager of another group => decision to keep him as a group manager member or remove

      Is Pete a group manager of another group => decision to add him as a group member or no action needed

      

Similar approach for all roles and groups (Service Owner, Lead and Executives)