Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Display job parameters

This scripts displays the parameters for all the jobs along with their default values (if applicable).

import hudson.model.*

for(item in Hudson.instance.items) {
  prop = item.getProperty(ParametersDefinitionProperty.class)
  if(prop != null) {
    println("--- Parameters for " + item.name + " ---")
    for(param in prop.getParameterDefinitions()) {
      try {
        println(param.name + " " + param.defaultValue)
      }
      catch(Exception e) {
        println(param.name)
      }
    }
    println()
  }
}

Sample ouput produced:

--- Parameters for GRA-00-UploadIntoClearCase ---
ONCSDAP1_USER jdoe
ONCSDAP1_PASSWORD 
GRA_ZIP_NAME GRA_Delivery_r.2.0.0_28-5_impl.zip
GRA_RELEASE n.28

--- Parameters for IN8-03-DeployXnetWebAppToRecette ---
STOP_START_AS 

Back to the top