diff --git a/src/shared/repositories/glpi.repository.js b/src/shared/repositories/glpi.repository.js index 6eac3fd..2a8d5b2 100644 --- a/src/shared/repositories/glpi.repository.js +++ b/src/shared/repositories/glpi.repository.js @@ -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) {