try { error "Exception" } catch(error) { def comment = "${BUILD_URL} FAILED - ${ERROR}" jiraAddComment idOrKey: 'GENERIC-999', comment: comment, site: 'YOURJIRASITE' currentBuild.result = 'FAILURE' }