Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Bucket Group mapping to Breakdown using script not working

venori26
Tera Contributor

Use case: need to group field values based on a condition that can be shown on dashboard.

 

Table: Incident

Field: category

Field Values: Network,Applications,Inquiry / Help,Database

Condition:

if category in (Network,Applications,Inquiry / Help) then 'Software' 

if category = Database then 'Hardware'

 

Dashboard view: 

 YTD CreatedYTD Remediated
Hardware123456
Software67891011

 

Bucket Groups: 

Hardware

Software

 

Breakdown mapping script:

var cat = function(x) {
var catvalue;

if (x == "Network" || x == "Applications" || x == "Inquiry / Help") {
catvalue = "Software";
}
else if (x == "Database") {
catvalue = "Hardware";
}
else {
catvalue = x;
}

return catvalue;
};

cat(current.category.toString());

 

Result: 

Breakdown selection is showing zero score in Analytics Hub

1 REPLY 1

venori26
Tera Contributor

solved