I'm trying to load a list that is returned from an API into a Jenkins parameter. For this I'm using uno-choice plugin and executing a Groovy script, because I want the parameter to appear depending on other existing parameters of the Jenkins job.
I have seen other plugins like http-request and rest-list-parameter but they don't work for me because the API response depends of the other parameters in the Jenkins job.
I have tested the solutions provided here and I was able to achieve what I wanted with sandbox deactivated when testing locally, but the Jenkins that my team uses has the sandbox activated and when I try to run the script again it fails without information or saying:
Failed to evaluate script: Scripts not permitted to use staticMethod
Requesting my company to allow me to run the script is not a solution either. Is it possible to call an API from groovy scripts with the sandbox activated?