<?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 Migrating Job Template properties via Python API in ArcGIS Workflow Manager Questions</title>
    <link>https://community.esri.com/t5/arcgis-workflow-manager-questions/migrating-job-template-properties-via-python-api/m-p/1259925#M1812</link>
    <description>&lt;P&gt;I'm currently working on a script to migrate diagrams and templates from one Workflow Manager instance to another. The &lt;A href="https://github.com/Esri/workflowmanager-samples/tree/master/ServiceBased" target="_self"&gt;samples&lt;/A&gt; provided me a good base through the WMX_MigrateWorkflows_PythonAPI.py script, but I noticed that it wasn't migrating all properties and I can't seem to update certain properties. In particular, I'd like to be able to update the default job name in the Job Template (i.e., be able to set something like "MyJob_[index]"), but this doesn't get passed from the source Workflow Manager item and I can't seem to update it.&lt;/P&gt;&lt;P&gt;Is there currently a way to update these properties that aren't part of the create_job_template method of the WorkflowManager object? (&lt;A href="https://developers.arcgis.com/python/api-reference/arcgis.gis.workflowmanager.html#workflowmanager" target="_self"&gt;link&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;My script looks something like this:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy
from arcgis.gis import GIS
from arcgis.gis.workflowmnager import WorkflowManager, JobTemplate

# get sources
source_gis = GIS('https://myurl.com','user1','pass1')
dest_gis = GIS('https://myurl.com','user1','pass1')
source_wf_item = source_gis.content.get('Source_WFM_ID')
dest_wf_item = dest_gis.content.get('Dest_WFM_ID')

source_wfm = WorkflowManager(source_wf_item)
dest_wfm = WorkflowManager(dest_wf_item)

source_job_template = source_wfm.job_template('SourceTemplateID123')

# creates destination template; the source's attributes are also filled in here, only mentioning name and priority for brevity
dest_new_template_id = dest_wfm.create_job_template('MyTemplate','Low')

dest_job_template = dest_wfm.job_template(dest_new_template_id)

# sets destination job template to source's, e.g 'MyJob_[index]'
dest_job_template.default_job_name = source_job_template.default_job_name

# throws an error - 'JobTemplate' object is not subscriptable
dest_wfm.update_job_template(dest_job_template)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 20 Feb 2023 21:17:43 GMT</pubDate>
    <dc:creator>RichardOxales</dc:creator>
    <dc:date>2023-02-20T21:17:43Z</dc:date>
    <item>
      <title>Migrating Job Template properties via Python API</title>
      <link>https://community.esri.com/t5/arcgis-workflow-manager-questions/migrating-job-template-properties-via-python-api/m-p/1259925#M1812</link>
      <description>&lt;P&gt;I'm currently working on a script to migrate diagrams and templates from one Workflow Manager instance to another. The &lt;A href="https://github.com/Esri/workflowmanager-samples/tree/master/ServiceBased" target="_self"&gt;samples&lt;/A&gt; provided me a good base through the WMX_MigrateWorkflows_PythonAPI.py script, but I noticed that it wasn't migrating all properties and I can't seem to update certain properties. In particular, I'd like to be able to update the default job name in the Job Template (i.e., be able to set something like "MyJob_[index]"), but this doesn't get passed from the source Workflow Manager item and I can't seem to update it.&lt;/P&gt;&lt;P&gt;Is there currently a way to update these properties that aren't part of the create_job_template method of the WorkflowManager object? (&lt;A href="https://developers.arcgis.com/python/api-reference/arcgis.gis.workflowmanager.html#workflowmanager" target="_self"&gt;link&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;My script looks something like this:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy
from arcgis.gis import GIS
from arcgis.gis.workflowmnager import WorkflowManager, JobTemplate

# get sources
source_gis = GIS('https://myurl.com','user1','pass1')
dest_gis = GIS('https://myurl.com','user1','pass1')
source_wf_item = source_gis.content.get('Source_WFM_ID')
dest_wf_item = dest_gis.content.get('Dest_WFM_ID')

source_wfm = WorkflowManager(source_wf_item)
dest_wfm = WorkflowManager(dest_wf_item)

source_job_template = source_wfm.job_template('SourceTemplateID123')

# creates destination template; the source's attributes are also filled in here, only mentioning name and priority for brevity
dest_new_template_id = dest_wfm.create_job_template('MyTemplate','Low')

dest_job_template = dest_wfm.job_template(dest_new_template_id)

# sets destination job template to source's, e.g 'MyJob_[index]'
dest_job_template.default_job_name = source_job_template.default_job_name

# throws an error - 'JobTemplate' object is not subscriptable
dest_wfm.update_job_template(dest_job_template)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Feb 2023 21:17:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-workflow-manager-questions/migrating-job-template-properties-via-python-api/m-p/1259925#M1812</guid>
      <dc:creator>RichardOxales</dc:creator>
      <dc:date>2023-02-20T21:17:43Z</dc:date>
    </item>
  </channel>
</rss>

