Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2026 09:40 PM
I believe that the "outputs" array isn't specifically declared, and rather, whatever is returned is understood as the output. Try this:
(function execute(inputs) {
var incNumber = inputs.incident_number;
var outputs = '';
if (!incNumber) {
outputs = "Error: Incident number not provided";
return;
}
var gr = new GlideRecordSecure("incident");
gr.addQuery("number", incNumber);
gr.query();
if (gr.next()) {
outputs += "Incident Found";
outputs += "Short description: " + gr.short_description.toString();
outputs += "State: " + gr.getDisplayValue("state");
outputs += "Caller: " + gr.getDisplayValue("caller_id");
} else {
outputs = "Incident Not Found";
}
return outputs;
})(inputs);