Juan_Cardona
Databricks Partner

Now The best practice for this is not using the API (some functions were deprecated for this objective) instead you should use job parameters 

job_id = dbutils.widgets.get("job parameter name with job_id")
job_run = dbutils.widgets.get("job parameter name with job_run")
job_name = dbutils.widgets.get("job parameter name with job_name")

Juan_Cardona_0-1748293834042.png

this list might not have all the job metadata

the list : ( to see the complete list just add as value over the parameter {{}} and a dropdown will appear.)

Juan_Cardona_1-1748293914615.png