-
Bug
-
Resolution: Not A Defect
-
Major
-
None
-
Jenkins ver. 2.73.3
Email-ext vers. 2.62
I am using the groovy-html.template which generates a link to the build and it is coming up as something like: nulljob/test/2 where test is the name of the job and 2 is the build number. The nulljob part is coming from the concatenation of null root URL and the job URL as can be seen from here:
<td><A href="${rooturl}${build.url}">${rooturl}${build.url}</A></td>
The rooturl property is coming from ExtendedEmailPublisherDescriptor.java.getHudsonUrl() as seen here
binding.put("rooturl", descriptor.getHudsonUrl());
This method internally just calls Jenkins.getActiveInstance().getRootUrl() as seen here:
public String getHudsonUrl() { return Jenkins.getActiveInstance().getRootUrl(); }
When I run the above API in Jenkins Script Console, I am getting the correct output:
print(Jenkins.getActiveInstance().getRootUrl())
This means, it is not a global configuration issue and from the code it is not obvious how a null value could creep in.
One may use this simple pipeline script to reproduce the issue: