SLA Definitions not triggering for new scoped app

Shane J
Tera Guru

I've created a new scoped app with some SLA definitions of of the custom table I extended off Task.  None of those Definitions are triggering.

When I try to run the SLA Validation UI Action I see this error message:

java.lang.NullPointerException

In the log, I see this error:  

wfv_gr.condition:;undefined
 
I've gone through everything here and none of it applies:  https://hi.service-now.com/kb_view.do?sysparm_article=KB0598456
 
 
I thought maybe the issue was due to Cross Scope but we have other scoped apps that don't seem to be having any issues.
 
Anyone else seen this before and know how to fix?
 
 
11 REPLIES 11

The code for that UI Actions is as follows:

function SlaTimelineDebugger() {
	var sysId = gel('sys_uniqueValue').value;
	var url = new GlideURL('$sla_timeline.do');
	url.addParam('sysparm_contract_sla_id',sysId);
	g_navigation.open(url.getURL());
}

So it is just opening a new window using the url "$sla_timeline.do?sysparm_contract_sla_id=SYS_ID"

I'm supposing the page is running server-side first which is throwing the error.

I found a reference to wfv_gr in Script Include SLAValidation.
This appears to be the offending function. There are two wfv_gr.condition checks.

SLAvalidation.workflowConditionEmpty = function(/* GlideElement */ workflow, /* optional: GlideElement */ condition_type, /* optional: GlideElement */ condition) {
	var workflowId = workflow + '';
	
	var wfv_gr = new GlideRecord("wf_workflow_version");
	wfv_gr.setWorkflow(false);
	wfv_gr.addQuery('workflow', workflowId);
	wfv_gr.addActiveQuery();
	wfv_gr.addQuery('published', true).addOrCondition('checked_out_by', gs.getUserID());
	wfv_gr.orderByDesc('checked_out_by');
	wfv_gr.query();
	while (wfv_gr.next()) {
		if (!wfv_gr.condition_type.nil() || (condition_type && !condition_type.nil())) {
			if (condition_type !== undefined)
				condition_type.setError(gs.getMessage("Workflow 'If condition matches:' value should be None"));
			return false;
		}
		gs.log('wfv_gr.condition:' + wfv_gr.condition + ';' + condition);
		if (!wfv_gr.condition.nil() || (condition && !condition.nil())) {
			if (condition !== undefined)
				condition.setError(gs.getMessage("Workflow condition should be empty"));
			return false;
		}
	}
	return true;
};

 

find_real_file.png

It has something to do with the Workflow - it doesn't seem to have the 'condition_type' field; or maybe this scope, in particular, doesn't have access to that field. Maybe cross scope privileges weren't correctly created?

Anyway, it probably has something to do with that. Try changing the Workflow to a different one?


Thanks


ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022

It's set.  I was playing around with it without a workflow as well, but still no go.