# How use sandbox for activeChoiceParam in job-dsl?

**URL:** <https://community.jenkins.io/t/how-use-sandbox-for-activechoiceparam-in-job-dsl/3811>\
**Category:** Ask a question\
**Created:** [September 16, 2022, 9:23am UTC](https://community.jenkins.io/t/how-use-sandbox-for-activechoiceparam-in-job-dsl/3811 "2022-09-16T09:23:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![patsevanton](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/patsevanton/32/1970_2.png) [@patsevanton](https://community.jenkins.io/u/patsevanton)\
**Post date:** [September 16, 2022, 9:23am UTC](https://community.jenkins.io/t/how-use-sandbox-for-activechoiceparam-in-job-dsl/3811/1 "2022-09-16T09:23:59Z")

</div>

Hello! I have code job-dsl

```auto
        pipelineJob('myjob') {
          parameters {
              activeChoiceParam('CURRENT_JOB') {
                filterable()
                choiceType('SINGLE_SELECT')
                groovyScript {
                  script("""\
                  return [
                  'XXX',
                  'YYY',
                  ]""")
                }
              }
          }
          definition {
            cps {
              script("""\
                pipeline {
                  agent any
                  stages {
                    stage ('build') {
                      steps {
                        withCredentials([string(credentialsId: 'XXX', variable: 'XXX')]) {
                          sh '''#!/bin/bash
                                my bash code
                          '''
                        }
                      }
                    }
                  }
                }""".stripIndent())
              sandbox()
            }
          }
        }

```

I try use activeChoiceParam, but get message

```auto
The script is not approved and will not be approved on save. Modify the script to approve it on save, or approve it explicitly on the Script Approval Configuration page

```

If i use sandbox by hand - job is word.  
i try use sanbox in job-dsl code, but sandbox not support: [job-dsl-plugin/ActiveChoiceGroovyScriptContext.groovy at 94d5aa82764ef808ab36c5e8ee0dd5404ef65844 · jenkinsci/job-dsl-plugin · GitHub](https://github.com/jenkinsci/job-dsl-plugin/blob/94d5aa82764ef808ab36c5e8ee0dd5404ef65844/job-dsl-core/src/main/groovy/javaposse/jobdsl/dsl/helpers/parameter/ActiveChoiceGroovyScriptContext.groovy#L8)

Error message: No signature of method: javaposse.jobdsl.dsl.helpers.parameter.ActiveChoiceGroovyScriptContext.sandbox()

How use sandbox for activeChoiceParam in job-dsl ? Thanks!

---

<div class="post-metadata">

**Author:** ![slide\_o\_mix](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/slide_o_mix/32/20977_2.png) [@slide\_o\_mix](https://community.jenkins.io/u/slide_o_mix)\
**Post date:** [September 16, 2022, 9:03pm UTC](https://community.jenkins.io/t/how-use-sandbox-for-activechoiceparam-in-job-dsl/3811/2 "2022-09-16T21:03:27Z")

</div>

Sounds like you need to file a bug on this.
