Hi,
When attempting to clone a workforce project with the following code (AGOL to AGOL), I'm receiving a "UnboundLocalError: local variable 'user' referenced before assignment" error. Any ideas? The same code works well for cloning a standalone feature class (such as the workforce assignment layer), and I'm pretty sure it worked on workforce projects in the past as well.
<SPAN class="keyword token">from</SPAN> arcgis<SPAN class="punctuation token">.</SPAN>gis <SPAN class="keyword token">import</SPAN> GIS
gis1 <SPAN class="operator token">=</SPAN> GIS<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"https://org1.maps.arcgis.com"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"user1"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"xyz"</SPAN><SPAN class="punctuation token">)</SPAN>
gis2 <SPAN class="operator token">=</SPAN> GIS<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"https://org2.maps.arcgis.com/"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"user2"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"xyz"</SPAN><SPAN class="punctuation token">)</SPAN>
item <SPAN class="operator token">=</SPAN> gis1<SPAN class="punctuation token">.</SPAN>content<SPAN class="punctuation token">.</SPAN>get<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"XXXXXXXXXXXXXXXXXXXXXXXXX"</SPAN><SPAN class="punctuation token">)</SPAN>
gis2<SPAN class="punctuation token">.</SPAN>content<SPAN class="punctuation token">.</SPAN>clone_items<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">[</SPAN>item<SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">)</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>