How to build scripted breakdown mapping for field that holds a string of sys id's with comma separated

Gal1
Kilo Guru

Hi All, 

I'm having an indicator on the metric_instance table. this metric holds in the 'field value' field two sys_id's separated by comma (string field).
And I have an indicator that has two breakdowns one is on the users the other is on the groups. 
Each one of the breakdowns has his own scripted breakdown mapping.
When I executing a job on this indicator I'm having this error : 


'
Error during JavaScript evaluation com.snc.pa.dc.ScriptException: JavaScript evaluation returned: Undefined in script: var getEngineerSysId = function(){
var str = current.field_value.getDisplayValue();
var arr = str.split(",");
return arr[1].toString();

};


at com.snc.pa.dc.Script.handleException(Script.java:215)
at com.snc.pa.dc.Script.evaluate(Script.java:176)
at com.snc.pa.dc.Script.evaluate(Script.java:156)
at com.snc.pa.dc.DataCollector.collect(DataCollector.java:385)
at com.snc.pa.dc.DataCollector.collect(DataCollector.java:313)
at com.snc.pa.dc.DataCollector.collect(DataCollector.java:247)

 


what am i doing wrong ? 

Thanks



The metric table:
find_real_file.png

 

 

Breakdown mapping script:

find_real_file.png

11 REPLIES 11

Adam Stout
ServiceNow Employee
ServiceNow Employee

Also, I generally don't see indicators directly on metric_instance, you normally want to create a view to join the main table with the metric.  Look at incident_metric as an example.

I think this might resolved my problem ill give a try and update. 

tnx