AWS Thinkbox Discussion Forums

Get JobID

Hi,
I’m trying to use Deadline job values according to this http://www.thinkboxsoftware.com/draft-using-job-values-recipe/. Problem is, ‘deadlineJobID’ isn’t set. After looking through DraftSubmission.py, it seems ‘deadlineJobID’ only gets set if you’re using Shotgun. How can I get the JobID in Draft without using Shotgun?

‘deadlineJobID’ should get set whenever the Draft job is created based on the output of another (different) Deadline Job. This includes creating Draft jobs through the right-click Job script, the Draft Event Plugin, and when submitting through Shotgun (as you pointed out).

If you’re just submitting a standalone Draft Job through the regular Monitor Submitter, it’s obviously not directly tied to any other Deadline Job, so it then does not pass in that argument.

I hope that cleared things up a little.

Cheers,

  • Jon

Thank you jgaudet. It does clear things up a little. My problem however is that I need to be able to get the Job ID from a standalone Draft Job. If that’s not possible, would I be able to pass the job user as an argument to draft on submission?

When submitting from the monitor, you can add additional custom parameters. You might find the following recipes helpful:
http://www.thinkboxsoftware.com/draft-using-custom-parameters/
http://www.thinkboxsoftware.com/draft-custom-args-recipe/
On the first link, there are instructions on how to add the parameters when running from the command line, but there’s also a field on the Deadline Monitor submission form for adding additional parameters. Do either of these do what you want?

Cheers,
Andrea

Hi Andrea,
I’ve been able to successfully pass parameters like ‘username’, ‘entity’, and ‘version’, but the problem with these is that they’re optional. So what I was trying to do, is if someone doesn’t fill in the Draft username, then it’ll just pull in the Deadline user as a replacement. I either have the option of getting the Deadline user when the Submit button is pressed and passing that as an argument to Draft, or getting it from Draft by searching the Deadline repository for the job. I can’t figure out how I can do either of these when Draft is submitted as a standalone job.

So to achieve something like that, you’d have to make modifications to the Draft Submission script (‘scripts/Submission/DraftSubmission/DraftSubmission.py’ in the repo).

An easy way to do something like this would be to look for this line:

args.append( 'username="%s" ' % scriptDialog.GetValue( "UserBox" ) )

and swap it with something like this:

user = scriptDialog.GetValue( "UserBox" )
if user == None or user.strip() == "":
    user = ClientUtils.GetDeadlineUser()
args.append( 'username="%s" ' % user )

Keep in mind that updating the Dealine repo could wipe custom changes like this to our built-in scripts, so it’d be up to you to maintain this.

Cheers,

  • Jon

Thank you Jon, that’s exactly what I was looking for!

Privacy | Site terms | Cookie preferences