Fix get email
testing/og-dhcp-API/pipeline/head There was a failure building this commit
Details
testing/og-dhcp-API/pipeline/head There was a failure building this commit
Details
parent
c136f004e9
commit
dbf5c9ebc0
|
@ -112,6 +112,10 @@ pipeline {
|
|||
|
||||
@NonCPS
|
||||
def getUserEmail(userId) {
|
||||
def user = jenkins.model.Jenkins.instance.getUser(userId)
|
||||
return user.getProperty(jenkins.plugins.mailer.tasks.Mailer.UserProperty)?.getAddress()
|
||||
def jenkinsInstance = jenkins.model.Jenkins.getInstanceOrNull()
|
||||
if (jenkinsInstance != null) {
|
||||
def user = jenkinsInstance.getUser(userId)
|
||||
return user.getProperty(jenkins.plugins.mailer.tasks.Mailer.UserProperty)?.getAddress()
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue