FIX: Corrigido bug que impedia a alteração de status

This commit is contained in:
Rafael Alves Lopes 2026-02-23 17:08:19 -03:00
parent c21c00075c
commit 0f412a1588

View File

@ -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 =================