First fix attempt for add_user_to_group/add_users_to_group failed — new error `‘Groups’ object h

What

First fix attempt for add_user_to_group/add_users_to_group failed — new error 'Groups' object has no attribute 'get_by_id'. TSC’s GroupsEndpoint does NOT expose get_by_id; that method exists on WorkbooksEndpoint/DatasourcesEndpoint but not Groups. Correct fix is to construct a GroupItem shell directly without a roundtrip lookup:

from tableauserverclient import GroupItem, UserItem
 
# Build minimal GroupItem with id set
group = GroupItem(name="placeholder")
group._id = group_id  # internal id setter
 
user = UserItem(name="placeholder")
user._id = user_id
 
server.groups.add_user(group, user_id)  # TSC accepts user_id as string for second arg

Alternative if _id private setter is undesirable: paginate server.groups.get() with RequestOptions().filter(Filter("id", Operator.Equals, group_id)) and pick first match — but that’s an extra network call per add. Direct GroupItem construction is the cleaner path.

Verify fix with both add_user_to_group (singular) and add_users_to_group (bulk) tools. Apply same pattern to remove_user_from_group/remove_users_from_group if they have the same defect.

Why

Same blocker as previous handoff — Rakesh Setia (Runwal CEO) onboarding still incomplete. AJ has chosen Path 2 (dev fix) and is awaiting closure. First fix iteration deployed but error class shifted; needs second iteration.

Action Required

  1. Replace server.groups.get_by_id(group_id) with GroupItem shell construction (snippet above). 2. Test against pending user feafd5f4-ccd0-457a-a3ae-9665cbd1fa46 + group 33ad82c3-9208-4b47-934c-6465c1a370ec. 3. Cascade rebuild + signal back. EA agent retries on signal.