Hi, I have a job which runs every 5 mins and emails if it fails. But, I want it to email only if the job fails more than Three times, not every single time. Is there a way or specific object to do this
Without knowing anything about your process, a quick solution could be:
1. Create a VARA Object VARA.COUNTER and specify the key FAILED_ATTEMPTS and add Value_1 as 0
2. Put this into the post process tab of your job
:SET &RETCODE# = GET_UC_OBJECT_STATUS():SWITCH "Y": CASE &RETCODE# between 1800 and 1899: SET &COUNTER# = GET_VAR(VARA.COUNTER, FAILED_ATTEMPTS): SET &COUNTER# = &COUNTER#+1: PUT_VAR VARA.COUNTER, "FAILED_ATTEMPTS","&COUNTER#": IF &COUNTER# > "3": SET &MAIL# = SEND_MAIL(.....): PUT_VAR VARA.COUNTER, "FAILED_ATTEMPTS", "0": ENDIF: OTHER: PUT_VAR VARA.COUNTER, "FAILED_ATTEMPTS", "0":ENDSWITCH
Alternatively, if you can using the RESTART TASK option within Automic, you can also use the internal system variable &$RESTART_COUNT# to monitor the restart count and put in the code accordingly to send email when the RESTART_COUNT reaches 3.
Hope this helps.
Retrieving data ...