I have a Jenkins multibranch pipeline and I am using a Jenkinsfile for CI flow. Now in my Jenkinsfile I would like to get the user who stopped pipeline in Jenkins Blueocean UI.
I have tried it using this:
try {
inputsubmitter = input message: 'Click Proceed to start Release for Branch ' + "${env.BRANCH_NAME}", submitter: 'jenkinusers', submitterParameter: 'submitters'
echo "${inputsubmitter}"
}
catch(Exception ex) {
def user = ex.getCauses()[0].getUser()
echo "Aborted by ${user} hello"
throw ex
}
But the result was:
aborted by system
How can I get the user in this context?