Error in Production - JSONObject["result"]

Today suddenly we have started to see the below error when a user try to place an access request, their is no code changes and unable to find where this error is coming from. I have attached error screen shot and log

  • An unexpected error occurred: sailpoint.tools.GeneralException: The application script threw an exception: org.json.JSONException: JSONObject[“result”] not found. BSF info: script at line: 0 column: columnNo*

    Log.txt (189.8 KB)

Hi @sunilasm,
Could you please check your system logs and share them here so we can understand the issue better?

Hey @sunilasm,

The error is occurring because the “result” key is missing from the JSON. It looks like you’re trying to access the “result” key, but it doesn’t exist in the JSON. You can add a check before accessing the value, like this:

if (jsonObject.has("result")) {
	String resultResponse = jsonObject.get( "result" );
	// Logic to perform on the result value...
} else {
	// Logic to perform in case "result" key is not present...
}
1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.