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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2019 12:11 PM
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:
Breakdown mapping script:
- Labels:
-
Performance Analytics
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2019 01:54 PM
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2019 01:20 AM
I think this might resolved my problem ill give a try and update.
tnx