Job Completion Alert – Add job failure text to the email alert

by May 11, 2021


The SMTP Action panel only shows these two lines:


$(Timestamp), $(Metric) on $(Instance) and host $(Hostname) is $(Severity).



It would be great if we can customizeTrim it so it would read as follows:



5/5/2021 11:09:07 AM, SQL Server Agent Job Completion on SERVER and host SERVER is Critical.


SQL Server Instance SERVER – SQL Agent job [Idera Job Failure] completed with a status of ‘Failed’ at 5/5/2021 11:07:32 AM.

The job failed.  The Job was invoked by User  X.  The last step to run was step 1 (T-SQL).




SQL Server Job history provides the actual error message:




Executed as user: X. Fail! [SQLSTATE 42000] (Error 50000).  The step failed.


I would like to include that text in the email notification.