Automic Workload Automation

 View Only

 Need help with including report in success email

Daniel White's profile image
Daniel White posted Oct 16, 2024 08:12 AM

I'm trying to find out if there's a way to include the contents of a job report inside an email that is sent to recipients when the job completes successfully. This is in the "post-process" tab. Here is the script so far:

:SET &job_report_path# = GET_VAR(UC_EX_PATH_JOBREPORT)
:SET &job_report_filename# = GET_ATT(FILENAME_SYSOUT)

:set &JRC# = get_uc_object_status(,,"RETCODE")

:PRINT &JRC#


:IF &JRC# = '0000000000000000'
:set &mail1# = send_mail('email goes here',,'PANDAC list directory Completed Successfully', 'email body goes here')
:set &mail1# = send_mail('email goes here',,'PANDAC list directory Completed Successfully', 'email body goes here')
:ENDIF

:IF &JRC# <> '0000000000000000'
:set &mail1# = send_mail('email goes here',,'PANDAC list directory has failed','put email body here')
:set &mail1# = send_mail('email goes here',,'PANDAC list directory has failed','put email body here')
:ENDIF

Any help on this would be great! Thank you

Markus Embacher's profile image
Broadcom Employee Markus Embacher

Hi Daniel,

try the notification object, it allows sending the report as an attachment to the message by just providing the RunID of a task. Alternatively you can compile the message in the Process tab of the notification object. You can place the notification object in your workflow the same way as jobs.

Regards, Markus