Event plugin to collect info on other jobs

Hi,

Quick question, which is maybe simple…

Scripting the custom event plugin. Know well how they work, except on thing:)

Whenever the trigger events fire up (OnJobSubmitted,…etc.) we get an object Job that represents the current Job that has triggered this event. Great! All good!

But now I need in the same code to actually check with the repository some information on OTHER jobs. Assumin I have the JobId of those other jobs. I have an array of those jobIds and I want to no on the OnJobSubmitted on the current job, to cycle through the IDs of other jobs and collect the status for example.

But I can not figure out what class / method I can use to do that:(

Any tips?:slight_smile: Thank you!

Hello

I think you can achieve that by doing something like:

You will need to create a for loop to traverse that list of jobIDs you have on OnJobSubmitted. Then get the status of each job using: Deadline Scripting Reference: Deadline.Scripting.RepositoryUtils Class Reference

Here is one example from our github event scripts: https://github.com/ThinkboxSoftware/Deadline/blob/master/Custom/events/SetJobInterruptible/SetJobInterruptible.py Which interrupts a job OnJobSubmitted event.

1 Like

Ah… Thank you! Was just missing the second argument and a small mix-up in all the classes!:slight_smile:
Works perfectly!!

1 Like