Hi @Ramesh Bathini , have you tried using dbutils? try this,
%scala
print (dbutils.notebook.getContext().jobId)
print (dbutils.notebook.getContext().currentRunId)
or
%scala
val jobId = sc.getLocalProperty("spark.databricks.job.id")
val runId = sc.getLocalProperty("spark.databricks.job.runId")
print("jobId")
print("runId")