[FIXED JENKINS-22699] Add option to archive only when successful