Debugging a scripted breakdown mapping in PA

Abhiji322
Tera Expert

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.

 

1 ACCEPTED SOLUTION

Abhiji322
Tera Expert

Addons to refer the issue.

 

Breakdown Source:

Abhiji322_1-1702881351803.png

Breakdown Mapping: 

Abhiji322_2-1702881465821.png

 

 

 

 

View solution in original post

6 REPLIES 6

Abhiji322
Tera Expert

First of all, Thank you for your response on this @Bert_c1,

I don't know if my requirement was confusing as I mentioned the word 'parent'. By the word 'Parent' I meant that I am looking for the parent of a record under some relations. Actually when I created a PA widget to represent the data, it has been working as expected using the script I mentioned above and it is obvious that there will not be a score generated if the script returns null. Now my question is why the scores were generated in analytics hub and it didn't in normal score view of an indicator.

 

Bert_c1
Kilo Patron

Can you find records in the 'pa_scores_l1' or 'pa_scores_l2' tables? You may want to create a Support Case for your issue. But I see you accepted a solution here.