user1536323
user1536323

Reputation: 31

Jenkins ActiveChoiceParam exceptions after Jenkins and plugin upgrade

After a recent jenkins version upgrade to 2.245 and ActiveChoice plugin to 2.1 and Scriptler plugin to 3.1. My dynamically generated job using scriptler now failed with the following error:

    No signature of method: javaposse.jobdsl.dsl.helpers.parameter.ActiveChoiceContext.scriptlerScript() is applicable for argument types: (java.lang.String, XyzJob$_run_closure1$_closure9$_closure23$_closure24$_closure25) values: [xyz.groovy, XyzJob$_run_closure1$_closure9$_closure23$_closure24$_closure25@31decd67]

The code is pretty simple like this (the error is at line scriptlerScript)

    parameters {
      activeChoiceParam(component.name.toString().replace("-","_")) {
        description(selectionDescription)
        choiceType('SINGLE_SELECT')
        scriptlerScript("xyz.groovy") {
          parameter("parameterItems", stringToUseInMenu)
        }
      }
    }

Upvotes: 2

Views: 601

Answers (1)

user1536323
user1536323

Reputation: 31

Further digging the scriptscripler() method has been removed from the new version of jobdsl hence the error.

The workaround seems to be rewrite the scriptler function to groovyscript or finding an alternative.

Upvotes: 1

Related Questions