Creating reference qualifier for CI field in Incident form

Filipp Fedorov
Kilo Guru

If a special service is selected I want to see only items that are related to that service so I made ref qual but it's not working.

Script Include

name: SAP_CI

Script: 

var SAP_CI = Class.create();
SAP_CI.prototype = {
    initialize: function() {},
    get_CI: function(service) {


        var ci = new GlideRecord('cmdb_ci');
        gs.log("I am workin", "Filipp");
        if (service == '3d2f748207381510b605ff208c1ed0c3') {

            gs.log("I am workin", script_includee);
            ci.addEncodedQuery('u_sap=true');
            ci.query();

        } else {
            ci.query();
        }
        answer = [];
        while (ci.next()) {
            answer.push(ci.getValue('sys_id'));

        }
    
        return 'sys_idIN' + answer;


    },

    type: 'SAP_CI'
};

Ref qual: javascript:  new SAP_CI().get_CI(current.business_service);

1 ACCEPTED SOLUTION

Filipp Fedorov
Kilo Guru

The reason was that I made changes in the task table not in dictionary override that's relate to incident

View solution in original post

5 REPLIES 5

Filipp Fedorov
Kilo Guru

The reason was that I made changes in the task table not in dictionary override that's relate to incident