Fixed job ID definition logic and tests