From a75bfadec89f01250bbee1dee150ef69c3bc53db Mon Sep 17 00:00:00 2001 From: Rafael Lopes Date: Wed, 10 Dec 2025 13:43:08 -0300 Subject: [PATCH] =?UTF-8?q?FIX:=20Chamados=20de=20implanta=C3=A7=C3=B5es?= =?UTF-8?q?=20s=C3=A3o=20abertos=20corretamente=20e=20einseridos=20no=20gr?= =?UTF-8?q?upo=20Implanta=C3=A7=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/shared/repositories/glpi.repository.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) 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) {