FIX : Evitar sobrescrição
This commit is contained in:
parent
0c6648b0b6
commit
a7f9f7f714
@ -41,7 +41,7 @@ const processStatusAndClosureController = async () => {
|
|||||||
|
|
||||||
const snIsFinalState = snCurrentStatus === 'Resolvido' || snCurrentStatus === 'Encerrado' || snCurrentStatus === 'Encerrado - Omitido';
|
const snIsFinalState = snCurrentStatus === 'Resolvido' || snCurrentStatus === 'Encerrado' || snCurrentStatus === 'Encerrado - Omitido';
|
||||||
let effectiveSourceLast = ticket.source_last;
|
let effectiveSourceLast = ticket.source_last;
|
||||||
if (snIsFinalState) {
|
if (snIsFinalState && ticket.source_last !== 'GLPI') {
|
||||||
effectiveSourceLast = 'SNOW';
|
effectiveSourceLast = 'SNOW';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -87,10 +87,10 @@ const processStatusAndClosureController = async () => {
|
|||||||
logInfo(`SN ${ticketSnDetails.ticket_number} foi Resolvido. Enviando nota para GLPI sem fechar o chamado...`);
|
logInfo(`SN ${ticketSnDetails.ticket_number} foi Resolvido. Enviando nota para GLPI sem fechar o chamado...`);
|
||||||
|
|
||||||
// Regra de negocio: resolucao vinda do SN nao fecha no GLPI.
|
// Regra de negocio: resolucao vinda do SN nao fecha no GLPI.
|
||||||
// Apenas registra uma nota e remove o ticket do monitoramento da integracao.
|
// Apenas registra uma nota e marca o fluxo como solucionado.
|
||||||
const collaboratorName = ticketSnDetails.updated_by || ticketSnDetails.closed_by || null;
|
const collaboratorName = ticketSnDetails.updated_by || ticketSnDetails.closed_by || null;
|
||||||
await addServiceNowClosureNoteToGlpi(ticket, collaboratorName, 'solucionado');
|
await addServiceNowClosureNoteToGlpi(ticket, collaboratorName, 'solucionado');
|
||||||
await TicketSyncModel.updateStatusAndSourceLast(ticket.sn_ticket_id, 'closed', 'closed', 'SNOW');
|
await TicketSyncModel.updateStatusAndSourceLast(ticket.sn_ticket_id, 'solved', 'solved', 'SNOW');
|
||||||
} else if (snCurrentStatus === 'Encerrado - Omitido' || snCurrentStatus === 'Encerrado') { // SN foi para 'Closed'
|
} else if (snCurrentStatus === 'Encerrado - Omitido' || snCurrentStatus === 'Encerrado') { // SN foi para 'Closed'
|
||||||
logInfo(`SN ${ticketSnDetails.ticket_number} foi Fechado. Enviando nota para GLPI sem fechar o chamado...`);
|
logInfo(`SN ${ticketSnDetails.ticket_number} foi Fechado. Enviando nota para GLPI sem fechar o chamado...`);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user