Tushar
Kilo Sage

Hi @Raja keerthana 

 

I hope this helps -

 

function getBusinessAppsHybrid() {
    var baHYBRID = [];
    var baCloud = new Set();
    var baNonCloud = new Set();

    var ga = new GlideRecord("cmdb_ci_business_app");
    ga.addEncodedQuery("install_status NOT IN 3, 10, 15");
    ga.query();

    while (ga.next()) {
        var gp = new GlideRecord("cmdb_ci_service_discovered");
        gp.addEncodedQuery("install_status NOT IN 10, 7, 15 ^ u_hosting_type IN ('Externally hosted - Cloud Infrastructure (IAAS/PAAS)', 'Externally hosted – Cloud Infrastructure (IAAS)', 'Externally hosted – Cloud Infrastructure (PAAS)', 'Externally hosted - SAAS') ^ u_cmdb_ci_business_app = " + ga.sys_id);
        gp.query();

        while (gp.next()) {
            baCloud.add(gp.u_cmdb_ci_business_app.sys_id.toString());
        }

        if (baCloud.has(ga.sys_id) && baNonCloud.has(ga.sys_id)) {
            baHYBRID.push(ga.sys_id.toString());
        }
    }

    return baHYBRID.toString();
}

 


Please, don't forget to mark my answer as correct if it solves your issue or mark it as helpful if it is relevant for you!

Regards,
Tushar