Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

set fullUrl

  • Loading branch information...
commit 09aafb8b0dad9f94819cebe095e126cb48cac818 1 parent 221aeb7
@masaki authored
View
12 src/main/java/com/tikal/hudson/plugins/notification/Protocol.java
@@ -2,6 +2,7 @@
import hudson.EnvVars;
import hudson.model.AbstractBuild;
+import hudson.model.Hudson;
import hudson.model.Job;
import hudson.model.ParameterValue;
import hudson.model.ParametersAction;
@@ -107,11 +108,12 @@ public void sendNotification(String url, Job job, Run run, Phase phase, String s
buildState.setUrl(run.getUrl());
buildState.setPhase(phase);
buildState.setStatus(status);
- try {
- buildState.setFullUrl(run.getAbsoluteUrl());
- } catch (IllegalStateException ignored) {
- // Ignored
+
+ String rootUrl = Hudson.getInstance().getRootUrl();
+ if (rootUrl != null) {
+ buildState.setFullUrl(rootUrl + run.getUrl());
}
+
jobState.setBuild(buildState);
ParametersAction paramsAction = run.getAction(ParametersAction.class);
@@ -139,4 +141,4 @@ public void validateUrl(String url) {
throw new RuntimeException("Invalid Url: hostname:port");
}
}
-}
+}
Please sign in to comment.
Something went wrong with that request. Please try again.