- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2023 10:02 AM
I am writing a scripted REST API to create or update a CI based on some JSON. The API resource lives in a scoped app and calls a script include in the same scope. When I send in the data, the API returns:
{
"http_status": "500",
"status_message": "Internal ServiceNow error: JavaException: java.lang.SecurityException: Invalid object in scoped script: [object SNC]. The value of output is: undefined"
}
I tried using SNC in two ways:
var output = JSON.parse(SNC.IdentificationEngineScriptableApi.createOrUpdateCI('REST API Import', input));
And:
var output = JSON.parse(new global.SNC.IdentificationEngineScriptableApi.createOrUpdateCI('LogicMonitor CMDB REST API', input));
They both produce the same error. How can I use SNC or is there something else I should be using?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2023 10:12 AM
I dislike scoped apps because of things like this.
Looks like there is a different object you need to be using

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2023 10:12 AM
I dislike scoped apps because of things like this.
Looks like there is a different object you need to be using