Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.
No ratings
Saviynt Employee
Saviynt Employee



Many applications like Service Now require JSON's to handle escape characters. If the escape characters are not handled properly, the SNOW ticket creation process can fail. This can be achieved by using the escapeJava method of the StringEscapeUtils() constructor. 



More Details:


1. public class StringEscapeUtils extends Object - Escapes and unescapes Strings for Java, Java Script, HTML, XML, and SQL.

2. escapeJava method details: 

  • public static String escapeJava(String str) - Escapes the characters in a String using Java String rules.
  • Deals correctly with quotes and control-chars (tab, backslash, cr, ff, etc.)
  • So a tab becomes the characters '\\' and 't'.
  • The only difference between Java strings and JavaScript strings is that in JavaScript, a single quote must be escaped.


            input string: He didn't say, "Stop!"

            output string: He didn't say, \"Stop!\"

  • Parameters: str - String to escape values in, may be null
  • Returns: String with escaped values, null if null string input



JSON Syntax in Saviynt: 



    "call": [{

        "name": "call1",

        "connection": "userAuth",

        "url": "",

        "httpMethod": "POST",

        "httpParams": "{\"u_emplid\":\"${user.username}\", \"u_vendor_name\":\"Sayvint\", \"u_assignment_group\":\"MSP L2 Essbase\", \"u_short_descr\":\"Snow Access - ${user.username}\", \"u_description\":\"${org.apache.commons.lang.StringEscapeUtils.escapeJava(reqAttrs.customproperty10)}\", \"u_vendor_case_number\":\"7\", \"u_config_item\":\"Essbase\", \"u_priority\":\"3-Medium\", \"u_comments\":\"abcd\", \"u_work_notes\":\"Saviynt\"}",

        "httpHeaders": {

            "Authorization": "${access_token}"


        "ticketidPath": "ticketNumber",

        "httpContentType": "application/json",

        "successResponses": {

            "statusCode": [








Further Reading:

Version history
Last update:
‎09/06/2023 08:13 PM
Updated by: