Add members to a group
Attach existing objects to a Standard group.
CoreStandardGroupUpdate with a members list replaces the current membership. To append, include the current members in the new list. The SDK and the web UI append by default.
This page applies to Standard groups. Generator and Query groups have their membership managed automatically by the Generator or query that owns them.
Prerequisites​
- An existing Standard group and its
hfid(or name). - The IDs of the objects you want to add.
Find the object IDs​
Before appending via GraphQL, look up the IDs of the objects you want to add:
query {
BuiltinTag(name__values: ["<value-1>", "<value-2>"]) {
edges {
node {
id
display_label
}
}
}
}
Replace BuiltinTag with the kind of object you're adding.
Add members​
- Web Interface
- GraphQL
- Python SDK
- Open the group from the Groups list.
- Go to the Members tab.
- Click Add Members and select the objects.
- Click Save.
Append — include any existing member IDs plus the new ones:
mutation AppendMembers {
CoreStandardGroupUpdate(
data: {
hfid: ["<group-name>"],
members: [
{id: "<existing-member-id>"},
{id: "<new-member-id-1>"},
{id: "<new-member-id-2>"}
]
}
) {
ok
}
}
If you omit existing IDs, those members will be removed.
group = client.get(kind="CoreStandardGroup", name__value="<group-name>")
obj_a = client.get(kind="<KindOfObject>", name__value="<value-a>")
obj_b = client.get(kind="<KindOfObject>", name__value="<value-b>")
group.members.add(obj_a)
group.members.add(obj_b)
group.save()
.members.add() appends; existing members are preserved.
Verify​
Use Query group membership to confirm the expected objects are attached.
Troubleshooting​
Called update but existing members disappeared. GraphQL update replaces the full list. Re-run with the existing IDs included.
Members don't appear. Confirm the object IDs are correct and that the objects exist on the same branch as the group.
Permission denied. You need write access to both the group and the members being attached.