How to Create Breakdown Mappings for Child Class Table when Breakdown Fact Table is a Base Table

Michael Zglesze
Giga Expert

Hello Community!

I hope I used the correct terminology in the Subject Line...  ðŸ™‚

Here's what I'm hoping to accomplish:  I have a breakdown created for a custom field, and that field is in the change_request table.  The Automated Indicator is built on the task_ci table because the process that we use at my company dictates that I pull information on Change Requests based on the CIs Affected.  Unfortunately, when I go to map the Breakdown, I can't get to the Extended Tables to select that field.

It looks like my solutions are the following three things:

1)  Create a Database View.  This isn't an option as I don't have access to do that, and our admins  don't want to take a performance hit on the system.

2)  Add a reference field on the form so that I can traverse it.  This isn't an option as, again, I don't have access to do that, and  our admins  don't want to take a performance hit on the system.

3)  Use the scripting capability.  This is totally doable, but I'm unsure how to return the information that ServceNow needs.

Is there I resource that I can refer to regarding Performance Analytics scripting, specifically?

Has anyone had the same issue and can maybe share some example code to do this?

Thanks, Community!  ðŸ™‚

1 ACCEPTED SOLUTION

Creating breakdown mapping to extended fields can be done thru scripts


below is a sample script where the "task" field is passed onto the function and it retrieves the incident category from the incident table



you can use this script to then attach to the breakdown mapping



var getIncCat = function (inc)


{


      gs.log("Getting info for inc: " + inc);


      var gr = new GlideRecord('incident');


      gr.get(inc);


      return gr.u_incident_category;


};


getIncCat(current.u_task);


View solution in original post

5 REPLIES 5

Teena Singh
ServiceNow Employee
ServiceNow Employee

Michael,


I will see if I can get an answer for you. Thanks.



Regards,


Teena Singh
Customer Experience: UX Strategy and Customer Insights
teena.singh@servicenow.com


ServiceNow


Screen Shot 2017-01-19 at 8.55.52 AM.png


Creating breakdown mapping to extended fields can be done thru scripts


below is a sample script where the "task" field is passed onto the function and it retrieves the incident category from the incident table



you can use this script to then attach to the breakdown mapping



var getIncCat = function (inc)


{


      gs.log("Getting info for inc: " + inc);


      var gr = new GlideRecord('incident');


      gr.get(inc);


      return gr.u_incident_category;


};


getIncCat(current.u_task);


THANK YOU SO MUCH, SOWMYA!



This is exactly what I was looking for!   I altered it to fit my needs and it worked beautifully!



I have everything built on the task_ci table, and need a field from the change_request table, and this did the trick:


---------------------------------------------------------------


var getSubPri = function (chg)


{


      gs.log("Getting info for chg: " + chg);


      var gr = new GlideRecord('change_request');


      gr.get(chg);


      return gr.u_submission_priority;


};


getSubPri(current.task);


---------------------------------------------------------------


Sowmya,



I have a similar requirement. I have my indicators on the incident table and need to break down by a field on the application table. The incident table references the CMDB_CI table and the field I need is on the cmdb_ci_appl table. I understand that a script is necessary but which table do I write this script to and what field? How do I map it to the breakdown source? Very new to PA and trying to learn as much as I can. Thank you in advance for you help.