Esri / arcgis-python-api

Documentation and samples for ArcGIS API for Python
https://developers.arcgis.com/python/
Apache License 2.0
1.88k stars 1.1k forks source link

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

Open avstjohn opened 6 months ago

avstjohn commented 6 months ago

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):

nanaeaubry commented 6 months ago

@achapkowski Can you advise?