Create a report

Shashi K
Tera Contributor

My requirement is create a report to how many similar changes have gone multiple CABs, not showing single records of CAB name.

so I have write the script and calling into the report but its not working. please help for this Thankyou.

 

function getDuplicateValues(table, field){
    var dupValues = [];
    var ga = new GlideAggregate(table);
    ga.addAggregate('COUNT', field);
    ga.addNotNullQuery(field);
    ga.groupBy(field);
    ga.addHaving('COUNT', '>', 1);
    ga.query();
    while (ga.next()) {
        dupValues.push(ga[field].toString());
    }
    return dupValues;
}
 
ShashiK_1-1700226007864.png

 

11 REPLIES 11

Omkar Kumbhar
Mega Sage
Mega Sage

Hello @Shashi K ,

Can you please try using the Javascript: new script_includename.function_name('pass the parameter');

If I was able to help you with your case, please click the Thumb Icon and mark as Correct.

where can i use? please show me

here,

OmkarKumbhar_0-1700226781528.png

 

If I was able to help you with your case, please click the Thumb Icon and mark as Correct.

Not working

ShashiK_0-1700227181584.png