{"id":1850,"date":"2020-04-06T22:16:22","date_gmt":"2020-04-06T19:16:22","guid":{"rendered":"https:\/\/artem.services\/?p=1846"},"modified":"2020-04-06T22:30:57","modified_gmt":"2020-04-06T19:30:57","slug":"1850","status":"publish","type":"post","link":"https:\/\/artem.services\/?p=1850&lang=en","title":{"rendered":"Jenkins &#8212; Active Choice: CheckBox &#8212; Default values"},"content":{"rendered":"<p><img loading=\"lazy\" class=\"aligncenter size-full wp-image-819\" src=\"https:\/\/artem.services\/wp-content\/uploads\/2019\/02\/Jenkins-Logo.png\" alt=\"\" width=\"1280\" height=\"412\" srcset=\"https:\/\/artem.services\/wp-content\/uploads\/2019\/02\/Jenkins-Logo.png 1280w, https:\/\/artem.services\/wp-content\/uploads\/2019\/02\/Jenkins-Logo-300x97.png 300w, https:\/\/artem.services\/wp-content\/uploads\/2019\/02\/Jenkins-Logo-768x247.png 768w, https:\/\/artem.services\/wp-content\/uploads\/2019\/02\/Jenkins-Logo-1024x330.png 1024w, https:\/\/artem.services\/wp-content\/uploads\/2019\/02\/Jenkins-Logo-954x307.png 954w\" sizes=\"(max-width: 1280px) 100vw, 1280px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>When working with the <strong>Active Choice CheckBox<\/strong> parameter, you can select the default values by adding the &quot;<strong>: selected<\/strong>&quot; parameter<\/p>\n<h3>Pipeline:<\/h3>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nproperties([\r\n  parameters([\r\n    [$class: 'CascadeChoiceParameter', \r\n      choiceType: 'PT_CHECKBOX', \r\n      description: 'Select environment',\r\n      filterLength: 1,\r\n      filterable: false,\r\n      name: 'Environment', \r\n      script: [\r\n        $class: 'GroovyScript', \r\n        script: [\r\n          classpath: [], \r\n          sandbox: false, \r\n          script: \r\n            'return[\\'Development:selected\\',\\'Production:selected\\']'\r\n        ]\r\n      ]\r\n    ]\r\n  ])\r\n])\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>When assembling with parameters, two environments at once, &quot;<strong>Development<\/strong>&quot; and &quot;<strong>Production<\/strong>&quot; will be selected by default<\/p>\n<p><img loading=\"lazy\" class=\"aligncenter size-full wp-image-1847\" src=\"https:\/\/artem.services\/wp-content\/uploads\/2020\/04\/Screenshot-2020-04-06-at-22.15.12.png\" alt=\"\" width=\"506\" height=\"154\" srcset=\"https:\/\/artem.services\/wp-content\/uploads\/2020\/04\/Screenshot-2020-04-06-at-22.15.12.png 506w, https:\/\/artem.services\/wp-content\/uploads\/2020\/04\/Screenshot-2020-04-06-at-22.15.12-300x91.png 300w\" sizes=\"(max-width: 506px) 100vw, 506px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; When working with the Active Choice CheckBox parameter, you can select the default values by adding the &quot;: selected&quot; parameter Pipeline: &nbsp; When assembling with parameters, two environments at once, &quot;Development&quot; and &quot;Production&quot; will be selected by default<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[613],"tags":[1465,1483,617,641,1485,1491],"_links":{"self":[{"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/posts\/1850"}],"collection":[{"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/artem.services\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1850"}],"version-history":[{"count":2,"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/posts\/1850\/revisions"}],"predecessor-version":[{"id":1852,"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/posts\/1850\/revisions\/1852"}],"wp:attachment":[{"href":"https:\/\/artem.services\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1850"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/artem.services\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1850"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/artem.services\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1850"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}