Esri/arcgis-python-api

Item.share() is not working when the groups parameter is specified

Opened this issue · 1 comments

Describe the bug
I am not able to share items with specified groups with the arcgis.gis.Item.share() method. I tried a hosted feature layer and a view of that HFL. The org and everyone parameters do work, but the groups parameter with a group ID string or with the Group object fails to change any sharing properties.
And the other way fails too: I set the group sharing manually in the Online Portal and then run groups=None, but nothing changes.

To Reproduce

view_items = gis_target.content.search(query=rf'title:{target_view_name}, type:"Feature Service"')
target_group_id = "TARGET GROUP ID"
group = gis_target.groups.get(groupid=target_group_id)
view_items[0].share(everyone=False, org=False, allow_members_to_edit=False, groups=[group])

Error
No error message, just failure to share the item with the specified group.

Screenshots
Fiddler sessions from running the above code.
image

Expected behavior
I expect the item to be shared with my specified group.

Platform (please complete the following information):

  • OS: Windows 11
  • Browser: Chrome
  • Python API Version: 2.2.0.1

Additional context
Add any other context about the problem here, attachments etc.

@achapkowski Can you advise?