From 0f412a15889fdeefb98a83a976f793e09cb4089a Mon Sep 17 00:00:00 2001 From: Rafael Lopes Date: Mon, 23 Feb 2026 17:08:19 -0300 Subject: [PATCH] =?UTF-8?q?FIX:=20Corrigido=20bug=20que=20impedia=20a=20al?= =?UTF-8?q?tera=C3=A7=C3=A3o=20de=20status?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/processStatusController.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/controllers/processStatusController.js b/src/controllers/processStatusController.js index adbb31f..a1c3804 100644 --- a/src/controllers/processStatusController.js +++ b/src/controllers/processStatusController.js @@ -41,11 +41,8 @@ const processStatusAndClosureController = async () => { // Compara o status real do GLPI com o status que temos do ServiceNow if (glpiLiveStatus !== null && glpiLiveStatusAsString !== snCurrentStatus) { logInfo(`Mudanca de status detectada no GLPI para o ticket ${ticket.glpi_ticket_id}. GLPI esta como '${glpiLiveStatusAsString}', SN esta como '${snCurrentStatus}'.`); - if (ticket.source_last !== 'SNOW') { - ticket.source_last = 'GLPI'; - } else { - logInfo(`Direcao mantida como SNOW -> GLPI para o ticket ${ticketSnDetails.ticket_number}.`); - } + // Hotfix: quando houver divergencia real de status, prioriza GLPI para restaurar fluxo GLPI -> SN. + ticket.source_last = 'GLPI'; } // ================= LÓGICA SNOW -> GLPI =================