<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Group sharing manager (item.sharing.groups) not updating item share settings in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/group-sharing-manager-item-sharing-groups-not/m-p/1600692#M11277</link>
    <description>&lt;P&gt;I've always suspected it was related to the number of shares on the item but could never figure out the threshhold.&amp;nbsp; The item I'm testing with is shared with more than 5 groups. I'm running on API version 2.4.0 and it appears there will be a fix in 2.4.1.&amp;nbsp; I'll do some more testing to verify I'm running into the same problem.&lt;/P&gt;</description>
    <pubDate>Sun, 30 Mar 2025 12:45:00 GMT</pubDate>
    <dc:creator>DonMorrison1</dc:creator>
    <dc:date>2025-03-30T12:45:00Z</dc:date>
    <item>
      <title>Group sharing manager (item.sharing.groups) not updating item share settings</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/group-sharing-manager-item-sharing-groups-not/m-p/1600677#M11275</link>
      <description>&lt;P&gt;Due to some item sharing apis being deprecated, I'm updating&amp;nbsp; my code to use the &lt;A href="https://developers.arcgis.com/python/latest/api-reference/arcgis.gis.toc.html#sharinggroupmanager" target="_self"&gt;group sharing manager&lt;/A&gt; APIs.&amp;nbsp; But I must be doing something totally wrong because when I check the item sharing states via the item -&amp;gt; overview -&amp;gt; share button, the api calls to add and remove the item from the group don't seem to have any effect.&amp;nbsp; I created a notebook (attached) with each step so I can do the sequences of share, test, unshare, test etc in any order. The code is listed below.&amp;nbsp; When I run this from start to finish,&amp;nbsp; the item appears not to be shared with the group.&amp;nbsp; Any ideas on what I'm doing wrong?&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis.gis import GIS
gis = GIS("home")
# Initialize item and group variables
ITEM_ID = '747f78beae544888aa58ebf3dd17b258'      
print (f"Item: {gis.content.get(ITEM_ID).title}")
GROUP_ID = 'dfedf7528fac409b8d96b0ffb940edd2'     
print (f"Group: {gis.groups.get(GROUP_ID).title}")
# Test if the item is shared with the group
print (GROUP_ID in [g.id for g in gis.content.get(ITEM_ID).sharing.shared_with['groups']])
# Unshare the item with group
gis.content.get(ITEM_ID).sharing.groups.remove(gis.groups.get(GROUP_ID))
# Share the item with the group
gis.content.get(ITEM_ID).sharing.groups.add(gis.groups.get(GROUP_ID))
# Print all items shared with the group
print([(i.id,i.title) for i in gis.groups.get(GROUP_ID).content(max_items=9999)])
# Print all groups that the item is shared with
print ([(g.id, g.title) for g in gis.content.get(ITEM_ID).sharing.shared_with['groups']])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 29 Mar 2025 21:11:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/group-sharing-manager-item-sharing-groups-not/m-p/1600677#M11275</guid>
      <dc:creator>DonMorrison1</dc:creator>
      <dc:date>2025-03-29T21:11:30Z</dc:date>
    </item>
    <item>
      <title>Re: Group sharing manager (item.sharing.groups) not updating item share settings</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/group-sharing-manager-item-sharing-groups-not/m-p/1600690#M11276</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/192850"&gt;@DonMorrison1&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Your code works perfectly fine for me as of API Version 2.4.0.&lt;/P&gt;&lt;P&gt;How many groups is the item already shared with? There seemed to be an initial bug when it was shared with more than 5 as per details &lt;A href="https://github.com/Esri/arcgis-python-api/issues/2180" target="_blank" rel="noopener"&gt;here&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;At least we can rule out that issue if your item is not shared with many groups.&lt;/P&gt;&lt;P&gt;All the best,&lt;/P&gt;&lt;P&gt;Glen&lt;/P&gt;</description>
      <pubDate>Sun, 30 Mar 2025 10:04:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/group-sharing-manager-item-sharing-groups-not/m-p/1600690#M11276</guid>
      <dc:creator>Clubdebambos</dc:creator>
      <dc:date>2025-03-30T10:04:55Z</dc:date>
    </item>
    <item>
      <title>Re: Group sharing manager (item.sharing.groups) not updating item share settings</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/group-sharing-manager-item-sharing-groups-not/m-p/1600692#M11277</link>
      <description>&lt;P&gt;I've always suspected it was related to the number of shares on the item but could never figure out the threshhold.&amp;nbsp; The item I'm testing with is shared with more than 5 groups. I'm running on API version 2.4.0 and it appears there will be a fix in 2.4.1.&amp;nbsp; I'll do some more testing to verify I'm running into the same problem.&lt;/P&gt;</description>
      <pubDate>Sun, 30 Mar 2025 12:45:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/group-sharing-manager-item-sharing-groups-not/m-p/1600692#M11277</guid>
      <dc:creator>DonMorrison1</dc:creator>
      <dc:date>2025-03-30T12:45:00Z</dc:date>
    </item>
    <item>
      <title>Re: Group sharing manager (item.sharing.groups) not updating item share settings</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/group-sharing-manager-item-sharing-groups-not/m-p/1602972#M11302</link>
      <description>&lt;P&gt;This is exactly my problem - thanks for finding that issue. I wasn't even aware of that git site's existence&lt;/P&gt;</description>
      <pubDate>Fri, 04 Apr 2025 20:17:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/group-sharing-manager-item-sharing-groups-not/m-p/1602972#M11302</guid>
      <dc:creator>DonMorrison1</dc:creator>
      <dc:date>2025-04-04T20:17:56Z</dc:date>
    </item>
  </channel>
</rss>

