Get the table name based on ticket number


getTableName: function(ticketNumber){
        var tableName='';
        var ticketPrefix=ticketNumber.replace(/\d*/g,'');
        if (ticketPrefix=='INC'){
            tableName='incident';
        }
        if (ticketPrefix=='PRB'){
            tableName='problem';
        }
        if (ticketPrefix=='PRB'){
            tableName='problem';
        }
        if (ticketPrefix=='CHG'){
            tableName='change_request';
        }
        if (ticketPrefix=='REQ'){
            tableName='sc_request';
        }
        if (ticketPrefix=='RITM'){
            tableName='sc_req_item';
        }
        if (ticketPrefix=='CTASK'){
            tableName='change_task';
        }
        if (ticketPrefix=='TASK'){
            tableName='sc_task';
        }
        return(tableName);
    },


Comments

Popular posts from this blog

Running transform maps asynchronously

Post a command to the ECC queue for the mid server to initiate a powershell file copy

GlideRecord setValue