Skip to content

Commit

Permalink
Merge pull request #50 from ikedam/feature/JENKINS-24626_AutoComplete…
Browse files Browse the repository at this point in the history
…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 06322b2
Showing 1 changed file with 16 additions and 0 deletions.
Expand Up @@ -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;
Expand Down Expand Up @@ -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.