Christopher_Mal
ServiceNow Employee
ServiceNow Employee

I am onsite working with a customer using the latest Berlin release. We had to build out a RBA workflow that uses the new REST libraries and functionality. Let me first say how powerful, dynamic, and amazing it is to be able to make a REST call (as defined by this customer) via a mid server and create a ticket in their current HPSM system.

The point of that long intro is to mention we did run into one issue the community should know about. If you are using variable replacement in a URL and your variable has a space, the current libraries do NOT escape spaces. You can not have spaces in a URL, so either manually use %20 or change the RestMessage ScriptInclude to escape spaces when they are used in the URL.

That is all I have for you today. I finally have 5 min to write.

This is how you can fix it in the script include:
There is a script include called RESTMessage. If you open it up and find the method _handleParameters, change the line that starts with param.value =… to:


param.value = '' + Packages.com.glide.util.StringUtil.urlEncode(value);


It should be line 362 I believe. That should substitute the space with a + and other special characters to their 3 byte values.