I'm using the ArcGIS Python API to report on items owned by users in my ArcGIS Online organization.
For each user I loop through their items and check the shared_with property to see which groups the item is shared with but it's always blank even on items I have manually checked that are shared with groups.
Has anyone run into this problem before?
A snippet from my script is below, the last line is causing the problem.
<SPAN class="comment token"># connect to organisation etc....</SPAN>
<SPAN class="keyword token">for</SPAN> user <SPAN class="keyword token">in</SPAN> gis<SPAN class="punctuation token">.</SPAN>users<SPAN class="punctuation token">.</SPAN>search<SPAN class="punctuation token">(</SPAN>max_users<SPAN class="operator token">=</SPAN><SPAN class="number token">9999</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">for</SPAN> folder <SPAN class="keyword token">in</SPAN> user<SPAN class="punctuation token">.</SPAN>folders<SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">for</SPAN> item <SPAN class="keyword token">in</SPAN> user<SPAN class="punctuation token">.</SPAN>items<SPAN class="punctuation token">(</SPAN>folder<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">if</SPAN> <SPAN class="operator token">not</SPAN> item<SPAN class="punctuation token">.</SPAN>shared_with<SPAN class="punctuation token">[</SPAN><SPAN class="string token">"groups"</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">:</SPAN>
<SPAN class="comment token"># log item</SPAN>
<SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>The result in my watch window in VS code is below.

For additional info, I'm an admin in the organisation and I'm using version 1.7.0 of the python API.