Is it possible to use the Jenkins credentials set in the global credentials in the active choice plugin groovy script? I'm trying to make an api call that returns a list and display that as a choices for a parameter using the active choice plugin.

But for that I need auth headers w credentials. How do I handle credentials? Is there a way to access them if I have them set up in the Jenkins credentials? (something like calling credentials(id) in the pipeline env)

  • The Java API docs for the credentials plugins are available online, so you may be able to figure out how to use them from an Active Choice script by poking through the API docs and trial/error (keep in mind that Active Choice scripts don't exactly have the best error reporting; you may want to debug in the script console or somewhere else first). However, I don't think anyone has written up any kind of tutorial on how to use the credential plugin Java API - at least, not that I can find. javadoc.jenkins.io/plugin/credentials/com/cloudbees/plugins/…
    – jayhendren
    Jun 22, 2022 at 16:20


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.