<?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: Can't share item to group using Python API in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/can-t-share-item-to-group-using-python-api/m-p/1130411#M6966</link>
    <description>&lt;P&gt;This is what I get -- I can pass in three different groups, all of which I created, and it will add one of them. Nothing matters, I pass individual IDs or I pass a list of IDs or I pass a list of group objects (as seen here) -- always the same -- it will share with some groups but not others. There has to be some magic "don't share with this one" flag that I can't see. Here's a snippet from a jupyter notebook.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;service_id = "e5b7345b622040f096fa923a807f55d0"

group_manager = gis.groups
gg = group_manager.search(query='GIS Team')[0]
print("group id", gg.id)
gc = group_manager.search(query='Cartographers')[0]
print("group id", gc.id)
ge = group_manager.search(query='Emergency Management')[0]
print("group id", ge.id)

content_manager = gis.content
service = content_manager.get(service_id)
print("service", service)

#rval = gis.content.share_items([service_id], groups=['Cartographers'])
rval = service.share(groups=[gg,gc,ge])
print("rval =", rval)

print('shared with', service.shared_with)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the output. Everything "succeeds" it always returns "success=True" and "notSharedWith" some of the inputs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;group id 53378c27d6b34383bc4fc2aa87fc630d
group id 8b6bd8ec1a4142f988119e6290af51d7
group id 0682bb6881ab41b691bedafd2f2740b2
service &amp;lt;Item title:"Surveys_MIL" type:Map Image Layer owner:bwilson@CLATSOP&amp;gt;
rval = {'results': [{'itemId': 'e5b7345b622040f096fa923a807f55d0', 'success': True, 'notSharedWith': ['', '53378c27d6b34383bc4fc2aa87fc630d', '8b6bd8ec1a4142f988119e6290af51d7']}]}
shared with {'everyone': False, 'org': False, 'groups': [&amp;lt;Group title:"Emergency Management" owner:bwilson@CLATSOP&amp;gt;]}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 04 Jan 2022 17:10:48 GMT</pubDate>
    <dc:creator>Brian_Wilson</dc:creator>
    <dc:date>2022-01-04T17:10:48Z</dc:date>
    <item>
      <title>Can't share item to group using Python API</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/can-t-share-item-to-group-using-python-api/m-p/865728#M4412</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a web map that I wish to share with a group in ArcGIS Enterprise. Using the Portal, I can share the map with the group:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 jive-image j-img-original" src="/legacyfs/online/436583_Capture 1.PNG" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-2 jive-image j-img-original" src="/legacyfs/online/436584_Capture 2.PNG" /&gt;&lt;BR /&gt;However, if I try to share the same map with the same group using the Python API, the map cannot be shared with the group:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class="" data-type="inline"&gt;&lt;DIV class=""&gt;&lt;DIV style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 5px; left: 348px;"&gt;&lt;TEXTAREA style="position: absolute; bottom: -1em; padding: 0px; width: 1px; height: 1em; outline: medium none currentcolor;" tabindex="0"&gt;&lt;/TEXTAREA&gt;&lt;/DIV&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;cbmt&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;share&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;org&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token boolean"&gt;True&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; groups&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;basemaps_group&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;title&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'notSharedWith'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'Basemaps / Cartes de base'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
 &lt;SPAN class="string token"&gt;'itemId'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'21e8f2ab90904f4ba38e44386f03851c'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;BR /&gt;Note that I am able to successfully share other maps (e.g., Esri basemaps) with this group within the same script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why can't I share the map with the group using the Python API?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 10:45:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/can-t-share-item-to-group-using-python-api/m-p/865728#M4412</guid>
      <dc:creator>JonathanBailey</dc:creator>
      <dc:date>2021-12-12T10:45:39Z</dc:date>
    </item>
    <item>
      <title>Re: Can't share item to group using Python API</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/can-t-share-item-to-group-using-python-api/m-p/865729#M4413</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It turns out that, in spite of &lt;A href="https://esri.github.io/arcgis-python-api/apidoc/html/arcgis.gis.toc.html#arcgis.gis.Item.share"&gt;what the API documentation says&lt;/A&gt; as of today, that you must share the item using the group's id, and not the group's name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="language-python"&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;cbmt&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;share&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;org&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token boolean"&gt;True&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; groups&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;basemaps_group&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;id&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;CODE&gt;&lt;SPAN class=""&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Feb 2019 20:51:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/can-t-share-item-to-group-using-python-api/m-p/865729#M4413</guid>
      <dc:creator>JonathanBailey</dc:creator>
      <dc:date>2019-02-06T20:51:08Z</dc:date>
    </item>
    <item>
      <title>Re: Can't share item to group using Python API</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/can-t-share-item-to-group-using-python-api/m-p/865730#M4414</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Jonathan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to share content with a user using the method that you recommended, but cannot get it figured out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a function that I wrote to try to do this. The function completes but doesn't actually show that anything was shared.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV style="color: #d4d4d4; background-color: #1e1e1e; font-weight: normal; font-size: 14px;"&gt;&lt;DIV&gt;&lt;SPAN style="color: #569cd6;"&gt;def&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #dcdcaa;"&gt;ShareItemToGroup&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;user1_&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;username1_&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;itemId_&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;groupId_&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #dcdcaa;"&gt;print&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;"Item:&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #569cd6;"&gt;{}&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;.format(itemId_))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #dcdcaa;"&gt;print&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;"Group:&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #569cd6;"&gt;{}&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;.format(groupId_))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;usergroups&amp;nbsp;=&amp;nbsp;user1_[&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;'groups'&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;usercontent&amp;nbsp;=&amp;nbsp;user1_.items()&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;group&amp;nbsp;=&amp;nbsp;gis.groups.get(groupId_)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #c586c0;"&gt;for&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;item&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #569cd6;"&gt;in&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;usercontent:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #c586c0;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;(item.id&amp;nbsp;==&amp;nbsp;itemId_):&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #c586c0;"&gt;try&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;item.share(&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;org&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #569cd6;"&gt;False&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;groups&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;=group)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #dcdcaa;"&gt;print&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;"Successfully&amp;nbsp;shared&amp;nbsp;item:&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #569cd6;"&gt;{}&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;&amp;nbsp;with&amp;nbsp;group:&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #569cd6;"&gt;{}&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;.format(itemId_,&amp;nbsp;groupId_))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #c586c0;"&gt;except&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #dcdcaa;"&gt;print&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;"Something&amp;nbsp;went&amp;nbsp;wrong..."&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 May 2020 21:24:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/can-t-share-item-to-group-using-python-api/m-p/865730#M4414</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2020-05-19T21:24:29Z</dc:date>
    </item>
    <item>
      <title>Re: Can't share item to group using Python API</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/can-t-share-item-to-group-using-python-api/m-p/865731#M4415</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I had the same issue as &lt;A href="https://community.esri.com/migrated-users/407297"&gt;Patty Charlotteson&lt;/A&gt;‌. The docs say you can pass in a list of group ID strings or a CSV of the same. Neither worked for me. They didn't crash, but nor did they do what I asked. Anyone at &lt;A href="https://community.esri.com/migrated-users/355028"&gt;ESRI GIS&lt;/A&gt; watching the forums for bugs?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As Patty showed, you can create a group object and pass that in to Item.share as the groups parameter. Note that &lt;A href="https://developers.arcgis.com/python/api-reference/arcgis.gis.toc.html#arcgis.gis.Item.share"&gt;the docs say&lt;/A&gt; you're supposed to pass in a &lt;STRONG&gt;list&lt;/STRONG&gt; of group objects, which I did and it worked. I only needed one group, so I only tried a one-element list.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Jun 2020 18:16:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/can-t-share-item-to-group-using-python-api/m-p/865731#M4415</guid>
      <dc:creator>davedoesgis</dc:creator>
      <dc:date>2020-06-11T18:16:09Z</dc:date>
    </item>
    <item>
      <title>Re: Can't share item to group using Python API</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/can-t-share-item-to-group-using-python-api/m-p/1046234#M5916</link>
      <description>&lt;P&gt;The errors above can also occur because items&amp;nbsp;cannot be shared with group having users_update_items=True.&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is defined when the group is created and cannot be changed later:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ugilad_esriau_0-1618289652846.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/10676i36328EE3A9C3572D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ugilad_esriau_0-1618289652846.png" alt="ugilad_esriau_0-1618289652846.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Apr 2021 04:56:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/can-t-share-item-to-group-using-python-api/m-p/1046234#M5916</guid>
      <dc:creator>UriGilad_EsriAu</dc:creator>
      <dc:date>2021-04-13T04:56:19Z</dc:date>
    </item>
    <item>
      <title>Re: Can't share item to group using Python API</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/can-t-share-item-to-group-using-python-api/m-p/1104289#M6702</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/7331"&gt;@JonathanBailey&lt;/a&gt;&amp;nbsp;- this solved my issue as well&lt;/P&gt;</description>
      <pubDate>Mon, 04 Oct 2021 03:16:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/can-t-share-item-to-group-using-python-api/m-p/1104289#M6702</guid>
      <dc:creator>SimonGIS</dc:creator>
      <dc:date>2021-10-04T03:16:47Z</dc:date>
    </item>
    <item>
      <title>Re: Can't share item to group using Python API</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/can-t-share-item-to-group-using-python-api/m-p/1105608#M6719</link>
      <description>&lt;P&gt;I had issues with this too. Had to pass it the group ID not the group itself.&lt;/P&gt;&lt;P&gt;Also encountered an unintended scenario where trying to share an item to a group was setting that item back to sharing level 'Owner' from 'Org' or 'Public'.&lt;/P&gt;&lt;P&gt;This may be on me for not reading the Python API docs enough, but what I found was that while I was only trying to add an item to a group with this method, because I hadn't specified a value for the everyone and org arguments, it was applying them to the item as well but using the default values. So the item was getting added to the intended group, and having it's everyone and org values set to False, which switched sharing for it back to 'Owner' breaking the apps and maps this item was a part of.&lt;/P&gt;&lt;P data-unlink="true"&gt;To avoid this, first use the &lt;A href="https://developers.arcgis.com/python/api-reference/arcgis.gis.toc.html#arcgis.gis.Item.shared_with" target="_self"&gt;shared with property of the item&lt;/A&gt; to gather the current sharing settings, and use those in addition to any sharing additions you are adding when using the &lt;A href="https://developers.arcgis.com/python/api-reference/arcgis.gis.toc.html#arcgis.gis.Item.share" target="_self"&gt;share method.&lt;/A&gt; Otherwise you may end up programmatically unintentionally changing the share settings for many items in your Org and suddenly have broken many public facing resources without knowing why.&lt;/P&gt;&lt;P data-unlink="true"&gt;I assumed the share method would allow you to change the share settings you specified, but what I found was that if I didn't specify every argument&amp;nbsp; (even the ones that weren't changing and were optional) the method changed them to the default anyways. Not great in my opinion and maybe ESRI can remedy that.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Oct 2021 16:53:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/can-t-share-item-to-group-using-python-api/m-p/1105608#M6719</guid>
      <dc:creator>MikeLachance1</dc:creator>
      <dc:date>2021-10-07T16:53:48Z</dc:date>
    </item>
    <item>
      <title>Re: Can't share item to group using Python API</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/can-t-share-item-to-group-using-python-api/m-p/1106289#M6724</link>
      <description>&lt;P&gt;This was the case for me.&amp;nbsp; You can share to a group with Update Capabilities, but you need to pass an additional argument to the share method (&lt;SPAN&gt;allow_members_to_edit=True).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;E.g.&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;map_item_id = 'c42004226e264f5389dbaf7d6fea60ae'
group_id = '591520ab3f2f421b83e271e1d40b74f3' # An Update Capable Group

map_item = gis.content.get(map_item_id)
if map_item:
    share_map = map_item.share(groups=group_id, allow_members_to_edit=True)

if share_map:
    print(share_map)

# -------------
{'results': [{'itemId': 'c42004226e264f5389dbaf7d6fea60ae',
   'success': True,
   'notSharedWith': []}]}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 10 Oct 2021 23:11:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/can-t-share-item-to-group-using-python-api/m-p/1106289#M6724</guid>
      <dc:creator>JustinReynolds</dc:creator>
      <dc:date>2021-10-10T23:11:26Z</dc:date>
    </item>
    <item>
      <title>Re: Can't share item to group using Python API</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/can-t-share-item-to-group-using-python-api/m-p/1130411#M6966</link>
      <description>&lt;P&gt;This is what I get -- I can pass in three different groups, all of which I created, and it will add one of them. Nothing matters, I pass individual IDs or I pass a list of IDs or I pass a list of group objects (as seen here) -- always the same -- it will share with some groups but not others. There has to be some magic "don't share with this one" flag that I can't see. Here's a snippet from a jupyter notebook.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;service_id = "e5b7345b622040f096fa923a807f55d0"

group_manager = gis.groups
gg = group_manager.search(query='GIS Team')[0]
print("group id", gg.id)
gc = group_manager.search(query='Cartographers')[0]
print("group id", gc.id)
ge = group_manager.search(query='Emergency Management')[0]
print("group id", ge.id)

content_manager = gis.content
service = content_manager.get(service_id)
print("service", service)

#rval = gis.content.share_items([service_id], groups=['Cartographers'])
rval = service.share(groups=[gg,gc,ge])
print("rval =", rval)

print('shared with', service.shared_with)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the output. Everything "succeeds" it always returns "success=True" and "notSharedWith" some of the inputs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;group id 53378c27d6b34383bc4fc2aa87fc630d
group id 8b6bd8ec1a4142f988119e6290af51d7
group id 0682bb6881ab41b691bedafd2f2740b2
service &amp;lt;Item title:"Surveys_MIL" type:Map Image Layer owner:bwilson@CLATSOP&amp;gt;
rval = {'results': [{'itemId': 'e5b7345b622040f096fa923a807f55d0', 'success': True, 'notSharedWith': ['', '53378c27d6b34383bc4fc2aa87fc630d', '8b6bd8ec1a4142f988119e6290af51d7']}]}
shared with {'everyone': False, 'org': False, 'groups': [&amp;lt;Group title:"Emergency Management" owner:bwilson@CLATSOP&amp;gt;]}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jan 2022 17:10:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/can-t-share-item-to-group-using-python-api/m-p/1130411#M6966</guid>
      <dc:creator>Brian_Wilson</dc:creator>
      <dc:date>2022-01-04T17:10:48Z</dc:date>
    </item>
    <item>
      <title>Re: Can't share item to group using Python API</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/can-t-share-item-to-group-using-python-api/m-p/1130426#M6967</link>
      <description>&lt;P&gt;The "magic flag" is the same as above -- I added this and it works now. Just always add this I guess.&lt;/P&gt;&lt;PRE&gt;, allow_members_to_edit=True&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jan 2022 17:36:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/can-t-share-item-to-group-using-python-api/m-p/1130426#M6967</guid>
      <dc:creator>Brian_Wilson</dc:creator>
      <dc:date>2022-01-04T17:36:55Z</dc:date>
    </item>
  </channel>
</rss>

