From a9df18a987a4c4e3173a68a4b8decf4d53c02ddc Mon Sep 17 00:00:00 2001 From: Nicolas Arenas Date: Tue, 1 Oct 2024 20:02:44 +0200 Subject: [PATCH] Get jenkinsintance from current context, to avoid script approval --- tests/API-dhcp/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/API-dhcp/Jenkinsfile b/tests/API-dhcp/Jenkinsfile index 182b81e..20b7070 100644 --- a/tests/API-dhcp/Jenkinsfile +++ b/tests/API-dhcp/Jenkinsfile @@ -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()