def content "Check console output at ${env.BUILD_URL} to view the results."
def buildURL = env.BUILD_URL
def newBuildURL = buildURL.replace("job/${env.JOB_NAME}", "blue/organizations/jenkins/${env.JOB_NAME}")
newBuildURL = newBuildURL.replace("job/${env.BRANCH_NAME}", "detail/${env.BRANCH_NAME}")
def buildURL = env.BUILD_URL
def newBuildURL = buildURL.replace("job/${env.JOB_NAME}", "blue/organizations/jenkins/${env.JOB_NAME}/detail/${env.JOB_NAME}")
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscribe@googlegroups.com.
emailext( |
Craig
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
Hi Mark,
I am using something like this in a groovy HTML template (for emailext):
def blueOceanDisplayUrlProvider = org.jenkinsci.plugins.displayurlapi.DisplayURLProvider.all().find { it.displayName == "Blue Ocean" }
String blueOceanPipelineUrl = blueOceanDisplayUrlProvider.getJobURL(project)
In case you are OK with globally changing default URL provider to Blue Ocean, then this might help you: https://issues.jenkins-ci.org/browse/JENKINS-41578
HTH Reinhold
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/bcf6f2fc-adcc-4ce9-a156-0698007a9ea3%40googlegroups.com.
java.lang.NullPointerException at io.jenkins.blueocean.rest.factory.organization.OrganizationFactory.getContainingOrg(OrganizationFactory.java:88) at org.jenkinsci.plugins.blueoceandisplayurl.BlueOceanDisplayURLImpl.getJobURL(BlueOceanDisplayURLImpl.java:91) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Thanks,
Mark.
Hi Mark,
Your suspicion sounds good to me: the “project” variable you are using must be wrong?
The source code for your NPE: https://github.com/jenkinsci/blueocean-plugin/blob/15e7e594f79930465582df7894f22d333a6966c1/blueocean-rest/src/main/java/io/jenkins/blueocean/rest/factory/organization/OrganizationFactory.java#L88
Not sure if this helps you right away, but the binding of “project” variable in email-ext plugin is seemingly defined like this: https://github.com/jenkinsci/email-ext-plugin/blob/9012fcd1b9b2040f2d34c2723198a751eb81cce5/src/main/java/hudson/plugins/emailext/plugins/content/ScriptContent.java#L125
I have found this old personal comment when getting started with groovy templates and email-ext plugin:
project
==
build.getParent() ...
org.jenkinsci.plugins.workflow.job.WorkflowJob - the job/project instance for this buildTo view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/5588d951-73bf-496a-973a-a67f48db87b4%40googlegroups.com.