Dylan Pedavoli
Dylan Pedavoli

Reputation: 1

Jenkins Parameters - Convert scripted pipeline syntax to declarative pipeline syntax

I am struggling to convert more advanced parameters from a scripted pipeline syntax into the declarative pipeline syntax. Example below from scripted pipeline syntax.

properties([
  parameters([
    [
      $class: 'ChoiceParameter',
      choiceType: 'PT_SINGLE_SELECT',
      name: 'Environment',
      script: [
        $class: 'ScriptlerScript',
        scriptlerScriptId:'Environments.groovy'
      ]
    ],
    [
      $class: 'CascadeChoiceParameter',
      choiceType: 'PT_SINGLE_SELECT',
      name: 'Host',
      referencedParameters: 'Environment',
      script: [
        $class: 'ScriptlerScript',
        scriptlerScriptId:'HostsInEnv.groovy',
        parameters: [
          [name:'Environment', value: '$Environment']
        ]
      ]
   ]
 ])
])

I have tried to use this scripted syntax in my declerative pipeline, but it does not understand this syntax.

Upvotes: 0

Views: 39

Answers (0)

Related Questions