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