CORE-4838: implemented most of the code to automagically populate the jobs table