Calling RiskCalculatorSNC.evaluateRiskImpact() from inside a Flow "Run flow in background (default)" throws NullPointerExceptionDescriptionCalling RiskCalculatorSNC.evaluateRiskImpact() from inside a Flow with "Run flow in background (default)" results in a NullPointerException thrown by GlideURI.java:57.Steps to Reproduce 1. Create a flow with a trigger: Created on Table: incident (leave everything else default).2. create an Action Script called "GlideURI call" and put the following in the script: var changeGr = new GlideRecord('change_request'); changeGr.initialize(); changeGr.setValue('short_description','example'); changeGr.setValue('type', 'normal'); changeGr.setValue('category','Hardware'); changeGr.insert(); var riskCalculator = new global.RiskCalculatorSNC(changeGr); riskCalculator.evaluateRiskImpact(); 3. Add the Action "GlideURI call" to the flow. 4. Create an incident.WorkaroundAdd the following function to ChangeRiskDetailsHelper Script Include: isServicePortal: function() { try { return (gs.action.getGlideURI() + "").indexOf("api/now/sp") !== -1; } catch (error) { return false; } }, Related Problem: PRB1434308