- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-15-2023 11:09 AM
Hi all,
My question is direct. Is there any way by which we can trace the output of a scripted breakdown mapping? I have one of the similar kind that never shows an error in the logs whenever the data collector job runs but the breakdown scores are not populated. [ Breakdown is not applied while computing the score].
A scripted mapping was necessary to fulfill the business requirement since dot-walking was not an option.
Requirement: A breakdown that segregates data based upon service. parent. subcategory to use on problem based indicators. I created a scripted as given below.
Facts table - Problem
Field(s) selected - service
var result=function(current){
var gr=new GlideRecord('cmdb_rel_ci');
gr. addEncodedQuery('child='+current. business_service. toString());
gr. query();
if(gr.next()){
return gr. parent. subcategory;
}
};
result(current);
[Ignore syntax errors]
Any suggestions much appreciated.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-17-2023 10:38 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-16-2023 12:18 PM
Post the Data Collection Job error, those are very useful and informative on what the problem is.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-17-2023 10:29 PM
@Bert_c1 , I think you haven't read my query properly. I said that the job is running fine without any errors but the scores are not getting populated breakdown wise.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-17-2023 10:38 PM
Addons to refer the issue.
Breakdown Source:
Breakdown Mapping:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-18-2023 01:23 PM
problem.business_service is a reference field to 'cmdb_ci_service'. Querying cmdb_rel_ci.child is not likely to work as intended as that field is a reference field to 'cmdb_ci'.
Your breakdown source is defined on the 'sys_choice' table. A query of that table using the 3 conditions you posted only returns records for 'subcategory' field on the 'cmdb_categories' table.
You do not return any value when the query on 'cmdb_rel_ci' record is not found. OOB scripted breakdowns do return a value or '' (null).
You should post your requirement, with details that include the Indicator, Indicator Source. Seems you want to have a breakdown on the choice value of 'subcategory' defined on the cmdb_rel_ci table, that matches the problem.business_service value?
There is a Performance Analytics course here: https://developer.servicenow.com/dev.do#!/learn/courses/vancouver
Good luck.
Also review the Data collection job log for any breakdown related information.