RuntimeException on Trouble Ticket Open API call

cody89677833602
Tera Contributor

Develop Instance, Washington DC Patch 4, Hotfix 1

 

When I try to run a curl command to create an incident via the Trouble Ticket Open API I receive this error:
```

com.glide.rest.util.RESTRuntimeException: No Content-Type set by API while streaming: org.mozilla.javascript.JavaScriptException: com.glide.rest.util.RESTRuntimeException: No Content-Type set by API while streaming: org.mozilla.javascript.Context.makeJavaScriptException(Context.java:2248)
org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:2230)
org.mozilla.javascript.MemberBox.invoke(MemberBox.java:163)
org.mozilla.javascript.FunctionObject.doInvoke(FunctionObject.java:717)
org.mozilla.javascript.FunctionObject.call(FunctionObject.java:654)
org.mozilla.javascript.ScriptRuntime.doCall(ScriptRuntime.java:2973)
org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1720)
org.mozilla.javascript.Interpreter.interpret(Interpreter.java:1030)
org.mozilla.javascript.InterpretedFunction.lambda$call$0(InterpretedFunction.java:161)
com.glide.caller.gen.sys_ws_operation_628997584f130110c5ff2624b2ce0b41_operation_script.call(Unknown Source)
com.glide.script.ScriptCaller.call(ScriptCaller.java:22)
org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:160)
org.mozilla.javascript.ScriptRuntime.doCall2(ScriptRuntime.java:3058)
org.mozilla.javascript.ScriptRuntime.doCall(ScriptRuntime.java:2981)
org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1720)
org.mozilla.javascript.Interpreter.interpret(Interpreter.java:1030)
org.mozilla.javascript.InterpretedFunction.lambda$call$0(InterpretedFunction.java:161)
com.glide.caller.gen.sys_ws_operation_628997584f130110c5ff2624b2ce0b41_operation_script.call(Unknown Source)
com.glide.script.ScriptCaller.call(ScriptCaller.java:22)
org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:160)
org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:725)
org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:4024)
org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:173)
com.glide.script.ScriptEvaluator.execute(ScriptEvaluator.java:412)
com.glide.script.ScriptEvaluator.evaluateString(ScriptEvaluator.java:223)
com.glide.script.ScriptEvaluator.evaluateString(ScriptEvaluator.java:141)
com.glide.script.fencing.GlideScopedEvaluator.evaluateScript(GlideScopedEvaluator.java:364)
com.glide.script.fencing.GlideScopedEvaluator.evaluateScript(GlideScopedEvaluator.java:251)
com.glide.script.fencing.GlideScopedEvaluator.evaluateScript(GlideScopedEvaluator.java:230)
com.glide.rest.service.custom.CustomService.runScript(CustomService.java:90)
com.glide.rest.service.custom.CustomService.execute(CustomService.java:77)
com.glide.rest.handler.impl.ServiceHandlerImpl.invokeService(ServiceHandlerImpl.java:37)
com.glide.rest.processors.RESTAPIProcessor.process(RESTAPIProcessor.java:345)
com.glide.processors.AProcessor.runProcessor(AProcessor.java:762)
com.glide.processors.AProcessor.processTransaction(AProcessor.java:313)
com.glide.processors.ProcessorRegistry.process0(ProcessorRegistry.java:187)
com.glide.processors.ProcessorRegistry.process(ProcessorRegistry.java:175)
com.glide.ui.GlideServletTransaction.process(GlideServletTransaction.java:58)
com.glide.sys.Transaction.run(Transaction.java:2734)
com.glide.ui.HTTPTransaction.run(HTTPTransaction.java:35)
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
java.base/java.lang.Thread.run(Thread.java:840)

```

 

The command is here:
```

curl -X POST "https://<instance_id>.service-now.com/api/sn_ind_tsm_sdwan/ticket/troubleTicket" --header "Accept:application/json" \
--header "Content-Type:application/json" --header "x-sn-apikey:  <api_key>"
```

 

Note that the User has the `sn_ind_tsm_sdwan.ticket_integrator` role and i can successfully hit the Table API with the same API KEY.


2 REPLIES 2

sach1
Tera Guru

where you able to identify the issue ?

 

Jace Benson
Mega Sage

I was able to get this to work by passing in the attribute of "ticketType" of "case".