This script locates the record in the Topographic_Production_Type table that has the same Production Type Name as the job number and copies the Data Source Name, Portal Item Name, and Portal Item URL values to the Topographic_Production_Properties table.
# Name: SetProductionProperties_sample.py
# Description: Locates the record in the Topographic_Production_Type table that has the same Production Type Name as the job
# and copies the Data Source Name, Portal Item Name, and Portal Item URL values to the Topographic_Production_Properties table.
# Import System Modules
import arcpy
# Check Out Extensions
arcpy.CheckOutExtension('Foundation')
arcpy.CheckOutExtension('DataReviewer')
arcpy.CheckOutExtension('JTX')
# Setting the environment
arcpy.env.overwriteOutput = True
# Setting Local Variables
job_id = 646
database_path = r"C:\Data\Workflows\Testing.jtc"
# Calling the Set Production Properties tool to set production property values for the job
arcpy.topographic.SetProductionProperties(job_id, database_path)
# Getting all messages, warnings, and errors from the tool run and printing the results back to the user
messages = arcpy.GetMessages(0)
warnings = arcpy.GetMessages(1)
errors = arcpy.GetMessages(2)
arcpy.AddMessage('Tool Messages: {}\nTool Warnings: {}\nTool Errors{}\n'.format(messages, warnings, errors))
# Check In Extensions
arcpy.CheckInExtension('Foundation')
arcpy.CheckInExtension('DataReviewer')
arcpy.CheckInExtension('JTX')