Get jenkinsintance from current context, to avoid script approval
parent
6fb97ba4a4
commit
a9df18a987
|
@ -112,7 +112,7 @@ pipeline {
|
|||
|
||||
@NonCPS
|
||||
def getUserEmail(userId) {
|
||||
def jenkinsInstance = jenkins.model.Jenkins.getInstanceOrNull()
|
||||
def jenkinsInstance = currentBuild.rawBuild.getParent().getParent()
|
||||
if (jenkinsInstance != null) {
|
||||
def user = jenkinsInstance.getUser(userId)
|
||||
return user.getProperty(jenkins.plugins.mailer.tasks.Mailer.UserProperty)?.getAddress()
|
||||
|
|
Loading…
Reference in New Issue