FIX: Chamados de implantações são abertos corretamente e einseridos no grupo Implantação

This commit is contained in:
Rafael Alves Lopes 2025-12-10 13:43:08 -03:00
parent 692ad0b583
commit a75bfadec8

View File

@ -63,12 +63,19 @@ async function insertEntity(entity_name){
}
async function insertGroupTicket(ticketId) {
async function insertGroupTicket(ticketId, type) {
try {
const groupId = 25
if (type !== 'IMPLANTACAO') {
groupId = 36; // Implantacao
}
const sql = ` INSERT INTO glpi_groups_tickets (tickets_id, groups_id, type)
VALUES (?, 25, 2)
VALUES (?, ?, 2)
`;
const values = [ticketId];
const values = [ticketId, groupId];
await glpi.execute(sql, values);
logInfo(`Grupo associado ao ticket GLPI ID: ${ticketId}`);
} catch (error) {