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 12:53 PM
Hi,
Could you please give a try with below code
getEngineerSysId: function(){
var str = current.field_value;
var arr = str.split(",");
return arr[1].toString();
},
Kindly mark my answer as Correct and helpful based on the Impact.
Regards,
Alok

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2019 01:07 PM
Hi Alok,
I tried this before and I get the same error :
'
Error during JavaScript evaluation com.snc.pa.dc.ScriptException: JavaScript evaluation returned: Undefined in script: var getEngineerSysId = function(){
var str = current.field_value;
var arr = str.split(",");
return arr[1].toString();
};
'

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2019 09:27 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2019 01:17 AM
My requirement is to measure the the time from incident creation to resolving, without monitor time - if exist - thats why im using a metric.
I should have 2 breakdowns - groups and users.
The metric table has only one field from type string that can holds sysId - thats why im putting over there the two sysIds.