Search code examples
jenkinsjenkins-pluginsjenkins-groovy

How to disable automatic escaping of "@" symbol in Active Choice Plugin?


I use the Active Choices Plugin (1) in my Jenkins Pipeline Job.

I want to display a list of email addresses, but the @ symbol is always replaced by "@". Unfortunately not only when displayed to the user, but also the parameter value passed to the job contains this replacement.

Is there a way to disable escaping? Or a possibility to escape the @ symbol to avoid escaping?

For testing I use the simple groovy snippet:

return  ['[email protected]']

Any help is highly appreciated!

Used versions: Jenkins 2.387.2, Active Choices Plugin 2.6.5

There exists a question ignoring the stackoverflow guidelines and never has been answered. It partly covers the same topic but only contains to screenshot images, no text or anything: Jenkins active choice parameter not understand the "@" symbol" and encodes it. How can one decode it while passing it as parameter in build command? I hope you accept me asking here.

(1) https://plugins.jenkins.io/uno-choice/


Solution

  • In case anyone needs this. i was having a similar issue and this solve it for me.

    first: ensure that the script section is not running in "sandbox" enter image description here

    second: if you get the message like "script not approved, and will not be approved after save" something like that, you can go to the scriptApproval section on jenkins (jenkins => manage jenkins => in-process script approval) and have it approved (link was beside the message in my case) if you don't have access to the approval page, you can speak with your jenkins admin

    this solved it for me.