Need more detail sending email if a job chain errors
Can someone point me in the right direction as to how to best:
1. Notify a person via email that a specific job chain has errored? I have been able to do this via a Step destination but I not only get "KILLED" states I get "COMPLETED" as well. I am only looking for a specific state.
2. The email needs to include in the subject the name of the job chain not just the job id. The id is not descriptive enough for us.
Seems like this would be simple to do but I cannot seem to find a thread that connects all the dots for me.
Thanks in advance.
glad to be of assistance. Simple change to make is to amend your query of rs_jobs, that determines the script name, to also test if the step_id field is null. It will only be null if the the job_id being tested is for the chain itself.
if p_new_status = 'E' then
select script_name , decode(step_id, null,'CHAIN','STEP')
into v_script, v_step_id
where job_id = p_job_id;
if v_script = 'my script' and v_step_id = 'CHAIN' then