Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Performance Analytics Job Throwing an Error

Himesh Murthy
Tera Contributor

Hello All,

I have a requirement to get the total number of incidents being resolved within 15 minutes of their creation using PA Indicator which will in turn be used in the formula Indicator to calculate further based on needs. 

I've created the below script in the Global application but the PA job throws following error - "Error during JavaScript evaluation com.snc.pa.dc.ScriptException: JavaScript evaluation returned: Undefined in script"

var getRecords = function() {
var created = current.sys_created_on;
var resolved = current.resolved_at;
var diff = gs.dateDiff(created, resolved, true);
var toMins = diff / 60;
var mins = parseInt(toMins);
if (mins < 15) {
return mins;
}
};

getRecords();

 

Indicator Created -

find_real_file.png

Please let me know if I am missing something here. 

 

Regards,

Himesh

5 REPLIES 5

Vishnu Prasad K
Giga Guru

Hi Himesh,

 

Did you added the fields used in 'Fields' field in the PA script? This should be done.