extended-choice-parameter plugin how to add choices list parameter depend on choices list parameter

5,376 views
Skip to first unread message

zacky azoulay

unread,
Nov 3, 2015, 10:48:28 AM11/3/15
to Jenkins Users

Hi

 

I try use the new extended-choice-parameter-plugin using JSON Parameter Config Groovy Script File it work fantastic

 

And I try to move more parameters to the new function for a better GUI.

 

I use also the Active Choices Plugin (https://wiki.jenkins-ci.org/display/JENKINS/Active+Choices+Plugin) to set interactively a choices list that depend on a select of another choices list.

 

For example I have one choices list ( region ) with ["us_west","us_east","europe"],

Depend on the selected region I run the script in Active Choices Plugin

def list = []

if (binding.variables.get('region') != null) {

    switch ( binding.variables.get('region') ) {

    case "europe":

        list = ['w_1', 'r_1', 'r_2']

break

    case "us_east":

        list = ['p_2', 'p_1']

break

    case "us_west":

         list = ['d_1']

break

    default:

       return []

    }

} else {

     return []

}

List

To set the choices list (availability_zone ) in the Active Choices Reactive parameter.

 

This is my json

 

Can you please help me to set the json .

     "items": {

        "type": "object",

       "id": "arr_region",

        properties: {

          region: {

            "type": "string",

            "enum": ["us_west","us_east","europe"]

          },

          az_us_east: {

            "type": "string",

           "options": {

               "collapsed": true

            },

            "enum": ["p_1","p_2"]

          },

          az_europe: {

            "type": "string",

           "options": {

               "collapsed": true

            },

            "enum": [“w_1”, “r_1”, “r_2”]

          },

          az_us_west: {

            "type": "string",

           "options": {

               "collapsed": true

            },

            "enum": ["d_1"]

          },                                     

          availability_zone: {

            "type": "string",                   

                "watch": {

                  "fregion": "arr_region.region",

   "faz_europe": "arr_region.az_europe",

   "faz_us_east": "arr_region.az_us_east",

   "faz_us_west": "arr_region.az_us_west",

              },

                   "enumSource": "fregion”

          }

 

Can you please help me to set it correctly .

 

Is it possible to set also a password parameters in Jason schema

 

Thank and regards zacky

 

ARYAN SHARMA

unread,
Jun 20, 2016, 5:32:25 AM6/20/16
to Jenkins Users
Hi,

I am trying to pass JSON parameter POST to my  HTTPS URL. I am not able to configure groovy scripti in Extend Choice Parameter as I am new to Groovy. Can you please share your groovy script and help me with JSON configuration in  Extend Choice Parameter plugin.

Thanks,
Aryan Sharma
Reply all
Reply to author
Forward
0 new messages