'Is there a way of preventing a Jenkins string parameter defaulting to the name of the parameter if empty?

I have a string variable in Jenkins that has a default value of an empty string. When I build my job, the value is set to the last part of the parameter name. So our paramater qa-release that was set to an empty string now has a value of release.

Due to the way our code is written, I need to sometimes send in an empty string. We are trying not to install too many plugins so I would prefer a solution that wouldn't require that. I have tried setting the value to the following, but all produce the above results

  • ""
  • """"
  • "''"
  • " "


Solution 1:[1]

If you are talking about the String Parameter, in the last Jenkins version (but I suppose even from before) you can leave empty the parameter field when you are starting the job, and it results in an empty string value associated to that parameter.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 makiSTB