<?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 Cannot create Workforce assignment in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/cannot-create-workforce-assignment/m-p/1206779#M7676</link>
    <description>&lt;P data-unlink="true"&gt;I am new to Python script writing, but I am trying to learn!&lt;/P&gt;&lt;P data-unlink="true"&gt;I wish to write a script that will create a Workforce assignment depending on the results from a fire hydrant inspection.&amp;nbsp; Both the inspection feature service and the Workforce service are hosted on our Enterprise Portal, version 10.9.1.&amp;nbsp; I tried to follow the section on this page &lt;A href="https://developers.arcgis.com/python/guide/managing-workforce-projects/" target="_blank"&gt;Managing Workforce projects | ArcGIS API for Python&lt;/A&gt;&amp;nbsp;that talks about creating a new assignment but I keep coming up with errors that I can't figure out how to fix.&amp;nbsp; I only really need three attributes to pass over to the assignments creation (geometry, assignment_type, and description) and looking at the page &lt;A href="https://developers.arcgis.com/python/api-reference/arcgis.apps.workforce.managers.html#assignmentmanager" target="_blank"&gt;arcgis.apps.workforce.managers module | ArcGIS API for Python&lt;/A&gt;&amp;nbsp;section for adding assignments it looked to me that all the attributes are optional, but I kept getting errors that there needs to be a location and the status can't be none so I added them as well.&lt;/P&gt;&lt;P data-unlink="true"&gt;Here's the code I've been trying:&lt;/P&gt;&lt;P data-unlink="true"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Python Code.jpg" style="width: 721px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/49557i56681FBA2BBB5548/image-size/large?v=v2&amp;amp;px=999" role="button" title="Python Code.jpg" alt="Python Code.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P data-unlink="true"&gt;And here's the output I'm getting:&lt;/P&gt;&lt;P data-unlink="true"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Python Result 1.jpg" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/49560iB6D994123EDF3523/image-size/large?v=v2&amp;amp;px=999" role="button" title="Python Result 1.jpg" alt="Python Result 1.jpg" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Python Result 2.jpg" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/49559iD7D3C86CAE52D479/image-size/large?v=v2&amp;amp;px=999" role="button" title="Python Result 2.jpg" alt="Python Result 2.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P data-unlink="true"&gt;I've done all the googling I can for now so I'm hoping to get some help here in either how to fix this code, or find a better way to script creating a new assignment.&amp;nbsp; Any help would be appreciated!&lt;/P&gt;&lt;P data-unlink="true"&gt;Brian&lt;/P&gt;</description>
    <pubDate>Fri, 26 Aug 2022 15:17:01 GMT</pubDate>
    <dc:creator>Brian_Laws</dc:creator>
    <dc:date>2022-08-26T15:17:01Z</dc:date>
    <item>
      <title>Cannot create Workforce assignment</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/cannot-create-workforce-assignment/m-p/1206779#M7676</link>
      <description>&lt;P data-unlink="true"&gt;I am new to Python script writing, but I am trying to learn!&lt;/P&gt;&lt;P data-unlink="true"&gt;I wish to write a script that will create a Workforce assignment depending on the results from a fire hydrant inspection.&amp;nbsp; Both the inspection feature service and the Workforce service are hosted on our Enterprise Portal, version 10.9.1.&amp;nbsp; I tried to follow the section on this page &lt;A href="https://developers.arcgis.com/python/guide/managing-workforce-projects/" target="_blank"&gt;Managing Workforce projects | ArcGIS API for Python&lt;/A&gt;&amp;nbsp;that talks about creating a new assignment but I keep coming up with errors that I can't figure out how to fix.&amp;nbsp; I only really need three attributes to pass over to the assignments creation (geometry, assignment_type, and description) and looking at the page &lt;A href="https://developers.arcgis.com/python/api-reference/arcgis.apps.workforce.managers.html#assignmentmanager" target="_blank"&gt;arcgis.apps.workforce.managers module | ArcGIS API for Python&lt;/A&gt;&amp;nbsp;section for adding assignments it looked to me that all the attributes are optional, but I kept getting errors that there needs to be a location and the status can't be none so I added them as well.&lt;/P&gt;&lt;P data-unlink="true"&gt;Here's the code I've been trying:&lt;/P&gt;&lt;P data-unlink="true"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Python Code.jpg" style="width: 721px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/49557i56681FBA2BBB5548/image-size/large?v=v2&amp;amp;px=999" role="button" title="Python Code.jpg" alt="Python Code.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P data-unlink="true"&gt;And here's the output I'm getting:&lt;/P&gt;&lt;P data-unlink="true"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Python Result 1.jpg" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/49560iB6D994123EDF3523/image-size/large?v=v2&amp;amp;px=999" role="button" title="Python Result 1.jpg" alt="Python Result 1.jpg" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Python Result 2.jpg" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/49559iD7D3C86CAE52D479/image-size/large?v=v2&amp;amp;px=999" role="button" title="Python Result 2.jpg" alt="Python Result 2.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P data-unlink="true"&gt;I've done all the googling I can for now so I'm hoping to get some help here in either how to fix this code, or find a better way to script creating a new assignment.&amp;nbsp; Any help would be appreciated!&lt;/P&gt;&lt;P data-unlink="true"&gt;Brian&lt;/P&gt;</description>
      <pubDate>Fri, 26 Aug 2022 15:17:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/cannot-create-workforce-assignment/m-p/1206779#M7676</guid>
      <dc:creator>Brian_Laws</dc:creator>
      <dc:date>2022-08-26T15:17:01Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot create Workforce assignment</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/cannot-create-workforce-assignment/m-p/1216287#M7811</link>
      <description>&lt;P&gt;So after a month of plugging away at this code . . . we've discovered that some of our other scripts that were previously working when we wrote them were now throwing some of the same errors as I was getting with this code.&amp;nbsp; (This seemed to happen after we upgraded to ArcGIS Pro 3.0)&amp;nbsp; After some trial and error with the previously working scripts we found that if we just connected with our Enterprise/Portal without specifying a username or password then the script would run as it did before.&amp;nbsp; I then tried the same thing with this script and it looked like it was going to work, but then after about 7 minutes I get the following errors:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Python Error 1.jpg" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/52224i8B9F85567355F2AB/image-size/large?v=v2&amp;amp;px=999" role="button" title="Python Error 1.jpg" alt="Python Error 1.jpg" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Python Error 2.jpg" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/52226iAD9C5080D7996D98/image-size/large?v=v2&amp;amp;px=999" role="button" title="Python Error 2.jpg" alt="Python Error 2.jpg" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Python Error 3.jpg" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/52225iCB37E1A8D041AF4F/image-size/large?v=v2&amp;amp;px=999" role="button" title="Python Error 3.jpg" alt="Python Error 3.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;It looks like it's connecting to the Workforce project, but can't write the new assignment and times out after some period of time.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Another troubleshooting step we tried was to create a Workforce project in ArcGIS Online and edit the code in the script to connect to ArcGIS Online, then connect to that project,&amp;nbsp; and then add an assignment to that new project.&amp;nbsp; It worked as expected.&lt;/P&gt;&lt;P&gt;As I said before, our Enterprise/Portal is at version 10.9.1 and we use Integrated Windows Authority (IWA) to have users log into that.&amp;nbsp; We have had issues with other Esri applications because we use IWA and I was wondering if that could be our issue here as well?&lt;/P&gt;&lt;P&gt;Again, any help would be appreciated.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Sep 2022 20:22:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/cannot-create-workforce-assignment/m-p/1216287#M7811</guid>
      <dc:creator>Brian_Laws</dc:creator>
      <dc:date>2022-09-26T20:22:23Z</dc:date>
    </item>
  </channel>
</rss>

