diff --git a/src/main/java/org/jenkinsci/plugins/ghprb/GhprbCause.java b/src/main/java/org/jenkinsci/plugins/ghprb/GhprbCause.java index b159cc1a9..aa01f9956 100644 --- a/src/main/java/org/jenkinsci/plugins/ghprb/GhprbCause.java +++ b/src/main/java/org/jenkinsci/plugins/ghprb/GhprbCause.java @@ -84,7 +84,13 @@ public GhprbCause(String commit, @Override public String getShortDescription() { - return "GitHub pull request #" + pullID + " of commit " + commit + (merged ? ", no merge conflicts." : ", has merge conflicts."); + String desc = "GitHub pull request "; + if (url != null) { + desc += "#" + pullID + ""; + } else { + desc += "#" + pullID; + } + return desc + " of commit " + commit + (merged ? ", no merge conflicts." : ", has merge conflicts."); } public String getCommit() {