Riada-AB / InsightManager

A simplified wrapper for the Insight Java API
Apache License 2.0
25 stars 13 forks source link

Initialization of inJsdBehaviourContext fails if IM is not executed via a HTTP request. #24

Closed jonnaranbrandt closed 3 years ago

jonnaranbrandt commented 3 years ago

insert question marks as per: inJsdBehaviourContext = new ExecutingHttpRequest()?.get()?.servletPath?.startsWith("/rest/scriptrunner/behaviours/latest/jsd/jsd")

AndersAtRiada commented 3 years ago

Nice find, this causes problems when IM is not executed via a HTTP request. Such as in an a scheduled ScriptRunner job.

2021-02-24 08:30:29,509+0000 Caesium-1-1 ERROR anonymous [c.o.scriptrunner.jobs.AbstractCustomScheduledJob] Script job: 'Testing ExecutingHttpRequest' failed java.lang.NullPointerException: Cannot get property 'servletPath' on null object at customRiadaLibraries.insightmanager.InsightManagerForScriptrunner.(InsightManagerForScriptrunner.groovy:153) at Script65.run(Script65.groovy:4)