Skip to content
Permalink
Browse files

Merge pull request #50 from ikedam/feature/JENKINS-24626_AutoComplete…

…ForDownstreamOf

[JENKINS-24626] Added auto-completion for project names in "Downstream build of".
  • Loading branch information...
ikedam committed Oct 12, 2014
2 parents c9809c8 + bdbfc6f commit 06322b202497b3468a85c97c2033d05c771060b4
Showing with 16 additions and 0 deletions.
  1. +16 −0 src/main/java/hudson/plugins/copyartifact/DownstreamBuildSelector.java
@@ -35,6 +35,7 @@

import hudson.EnvVars;
import hudson.Extension;
import hudson.model.AutoCompletionCandidates;
import hudson.model.Item;
import hudson.model.AbstractBuild;
import hudson.model.AbstractProject;
@@ -255,5 +256,20 @@ public FormValidation doCheckUpstreamBuildNumber(

return FormValidation.error(Messages.DownstreamBuildSelector_UpstreamBuildNumber_NotFound());
}

/**
* Fill the project name automatically.
*
* @param value
* @param project
* @return
*/
public AutoCompletionCandidates doAutoCompleteUpstreamProjectName(
@QueryParameter String value,
@AncestorInPath AbstractProject<?,?> project
) {
// Specified Item to allow to autocomplete folders (maybe confusing...).
return AutoCompletionCandidates.ofJobNames(Item.class, value, project, project.getParent());
}
}
}

0 comments on commit 06322b2

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