Scripts Write to ExtraInfo

How to write any info to ExtraInfo
i want use it in PreJobScript. I tried use

def __main__( *args ):
    deadlinePlugin = args[0]
    job = deadlinePlugin.GetJob()
    job.set_ExtraInfo0 = "test"

also tried job.ExtraInfo0 = "test"
but i got error with “read-only attribute”

The property is job.JobExtraInfo0 and you should be able to get and set it. After settings it, you must call RepositoryUtils.SaveJob(job) so it sticks.

https://docs.thinkboxsoftware.com/products/deadline/10.1/2_Scripting%20Reference/class_deadline_1_1_jobs_1_1_job.html#aec0f509bcfebc5967908b66ffce9f0a2

I saved the following in a JobExtraInfoPreScript.py file and assigned to a Job on the queue:

from Deadline.Scripting import *

def __main__( *args ):
    deadlinePlugin = args[0]
    job = deadlinePlugin.GetJob()
    job.JobExtraInfo0 = "test"
    RepositoryUtils.SaveJob(job)
    print (job.JobExtraInfo0)

After running the job, I got “test” in the Extra Info 0 field:

image

2 Likes

A curiosity that should be mentioned - the Job property .JobExtraInfo0 can also be accessed as .ExtraInfo0. This is true for almost all Job properties, e.g. job.JobMinRenderTimeSeconds and job.MinRenderTimeSeconds are equivalent. An exception is job.JobId which cannot be shortened to job.Id.