SLA Definitions not triggering for new scoped app
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2020 05:31 AM
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:

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2020 06:12 AM
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;
};
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2020 06:29 AM