Skip to end of metadata
Go to start of metadata

There is Job Parameter Summary Plugin to visualize 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 
  • No labels

1 Comment

  1. What if I wanted to do the same for other things? Where can I find a list of valid objects that I can pass to `item.getProperty()`?

    I want to iterate over repository URLs.

    Thanks!!