View Source

h1. Situation
When prompt build options for a manually triggered build, it is often desirable to chain two or more selection boxes together so that available choices of latter selection box are calculated based on selected value of prior selection box.

h1. Demonstration
# Switch to the [demo configuration|http://demo.pmease.com/overview/96], and hit the run button.
# The build option page prompts user to select a directory and a file inside that directory.
# Select a directory, and available choices of the file selection box will change to reflect contained files under that directory.
# Run the build, and check the [build log|http://demo.pmease.com/build/96.latest]. The selected directory name and file name will be printed there as a demonstration.

h1. Resolution
# Switch to [variables definition|http://demo.pmease.com/settings/96/variables] of the demo configuration.
# The variable _dir_ is defined to prompt as a selection box, with choices field defined as a groovy script returning all sub directory names under _/home/pmease/skyagent_.
# The variable _file_ is defined to prompt as a selection box, with choices field defined as a groovy script returning all file names under the selected sub directory.
# Check the [steps definition|http://demo.pmease.com/settings/96/steps], a test step is added to print selected value of the directory and file.