job.set_Department not updating in monitor

I have an event plugin that I want to use to modify the job department on submission and discovered that it’s not updating in the monitor.

[...] def OnJobSubmitted(self, job): header() if job.JobUserName == "brett.bronson": job.set_Department("Dev") print job.JobDepartment [...]

output from job reports:

[code]=======================================================
Log

PYTHON: [ INFO] --------------------------------------------------------------------------------
PYTHON: [ INFO] bbPipeline
PYTHON: [ INFO] --------------------------------------------------------------------------------
PYTHON: Dev
[/code]

It shows the department as set when printing job.JobDepartment in the reports, however, the Deadline monitor does not update with this set information.

I was, however, able to set a value and have the deadline monitor display it by running:

c:\Program Files\Thinkbox\Deadline6\bin>deadlinecommand.exe SetJobSetting 5339f260fd259d3394cad4da Department DEV Set Department to DEV

The documentation shows:

5.2.3.5 string Deadline.Jobs.Job.JobDepartment [get], [set] The department to which the job’s user belongs to.

job.JobDepartment is of type unicode, there’s no method for setting or getting so I’m confused by the [get], [set]. Nowhere else in the documentation stated where the set method was so I found it by doing:

for f in dir(job): print f

Hi Brett,
The [get] and [set] are simply displaying that a particular job property can be read from & written to.
You can [set] the property like this:

[code] def OnJobSubmitted(self, job):
header()
if job.JobUserName == “brett.bronson”:

        job.JobDepartment = "Dev"
        RepositoryUtils.SaveJob( job )

        print job.JobDepartment[/code]

Don’t forget to save all the changes to the job object back to the DB by using that 2nd line:

RepositoryUtils.SaveJob( job )

Perfect! I’ll give that a shot.

Thanks!