<?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 How to add attachments to workforce assignment with arcpy and arcgis workforce api? in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-add-attachments-to-workforce-assignment/m-p/1016280#M5416</link>
    <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;I am creating workforce assingments with python and with workforce python api following &lt;A href="https://github.com/Esri/workforce-scripts/blob/master/scripts/create_assignments_from_csv.py" target="_self"&gt;this&lt;/A&gt; tutorial from github. I can create the assignments successfully and the assignments appear in workforce, but I can't see the attachments and I don't get any errors.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy, requests, os, sys, json, types
from arcgis.gis import GIS
from arcgis.apps import workforce

# do some stuff here, get the project and assingment types and so on
assignments_to_add = []
for stuff in stuffs:
    assignment_to_add = workforce.Assignment(project, 
    assignment_type=assignmentTypes_dict[assignmentType], status = "assigned")

    # add other nessesary thing to assignment and do some stuff here

    # add attachments
    # this doesn't work but doesn't give any error either and assignments are added to workforce without attachment 
    assignment_to_add.attachment_file = types.SimpleNamespace()
    # just tying to add one simple image from file
    assignment_to_add.attachment_file = "C:/image.jpg"

assignments = project.assignments.batch_add(assignments_to_add)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is link above is only example i found with attachments, is something changed in the api?&lt;/P&gt;</description>
    <pubDate>Wed, 13 Jan 2021 07:58:59 GMT</pubDate>
    <dc:creator>RistoÜlem</dc:creator>
    <dc:date>2021-01-13T07:58:59Z</dc:date>
    <item>
      <title>How to add attachments to workforce assignment with arcpy and arcgis workforce api?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-add-attachments-to-workforce-assignment/m-p/1016280#M5416</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;I am creating workforce assingments with python and with workforce python api following &lt;A href="https://github.com/Esri/workforce-scripts/blob/master/scripts/create_assignments_from_csv.py" target="_self"&gt;this&lt;/A&gt; tutorial from github. I can create the assignments successfully and the assignments appear in workforce, but I can't see the attachments and I don't get any errors.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy, requests, os, sys, json, types
from arcgis.gis import GIS
from arcgis.apps import workforce

# do some stuff here, get the project and assingment types and so on
assignments_to_add = []
for stuff in stuffs:
    assignment_to_add = workforce.Assignment(project, 
    assignment_type=assignmentTypes_dict[assignmentType], status = "assigned")

    # add other nessesary thing to assignment and do some stuff here

    # add attachments
    # this doesn't work but doesn't give any error either and assignments are added to workforce without attachment 
    assignment_to_add.attachment_file = types.SimpleNamespace()
    # just tying to add one simple image from file
    assignment_to_add.attachment_file = "C:/image.jpg"

assignments = project.assignments.batch_add(assignments_to_add)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is link above is only example i found with attachments, is something changed in the api?&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2021 07:58:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-add-attachments-to-workforce-assignment/m-p/1016280#M5416</guid>
      <dc:creator>RistoÜlem</dc:creator>
      <dc:date>2021-01-13T07:58:59Z</dc:date>
    </item>
  </channel>
</rss>

