Skip to content
Browse files

[FIXED JENKINS-22590] Use a combobox, not a pulldown, for permalink s…


Enables a promotion name to be specified even when the upstream job name is not statically known.
  • Loading branch information
jglick committed Apr 14, 2014
1 parent 4371497 commit 15d52b10ccc4290e8303e2f8f5fca4ef06a1f89e
@@ -30,8 +30,7 @@
import hudson.model.Job;
import hudson.model.PermalinkProjectAction.Permalink;
import hudson.model.Run;
import hudson.util.ListBoxModel;
import hudson.util.ListBoxModel.Option;
import hudson.util.ComboBoxModel;
import jenkins.model.Jenkins;
import org.kohsuke.stapler.AncestorInPath;
import org.kohsuke.stapler.DataBoundConstructor;
@@ -65,15 +64,14 @@ public String getDisplayName() {
return Messages.PermalinkBuildSelector_DisplayName();

public ListBoxModel doFillIdItems(@AncestorInPath Job defaultJob, @RelativePath("..") @QueryParameter("projectName") String projectName) {
// gracefully fall back to some job, if none is given
public ComboBoxModel doFillIdItems(@AncestorInPath Job copyingJob, @RelativePath("..") @QueryParameter("projectName") String projectName) {
Job j = null;
if (projectName!=null) j = Jenkins.getInstance().getItem(projectName,defaultJob,Job.class);
if (j==null) j = defaultJob;

ListBoxModel r = new ListBoxModel();
for (Permalink p : j.getPermalinks()) {
r.add(new Option(p.getDisplayName(),p.getId()));
if (projectName != null) {
j = Jenkins.getInstance().getItem(projectName, copyingJob, Job.class);
ComboBoxModel r = new ComboBoxModel();
for (Permalink p : j != null ? j.getPermalinks() : Permalink.BUILTIN) {
return r;
@@ -24,6 +24,6 @@ THE SOFTWARE.
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:f="/lib/form">
<f:entry title="${%Permalink}" field="id">
<f:select />

0 comments on commit 15d52b1

Please sign in to comment.
You can’t perform that action at this time.