->Select SQL
SELECT HD_TICKET.ID as ID,HD_TICKET.TITLE as TITLE,
E.FULL_NAME as SOLICITANTE,
DONO.FULL_NAME as ATENDENTE,
E.EMAIL as EMAIL_SOLICITANTE,
HTC.COMMENT AS COMENTARIO,
S.NAME AS ESTADO
FROM(HD_TICKET, HD_PRIORITY, HD_STATUS, HD_IMPACT, HD_CATEGORY)
left join USER DONO on DONO.ID = HD_TICKET.OWNER_ID
LEFT JOIN USER E on E.ID = HD_TICKET.SUBMITTER_ID
LEFT JOIN HD_STATUS S ON (HD_TICKET.HD_STATUS_ID = S.ID)
inner Join ( Select TC.HD_TICKET_ID, max(TC.ID) IDFilho from HD_TICKET_CHANGE TC
inner join HD_TICKET_CHANGE_FIELD F on ( F.HD_TICKET_CHANGE_ID = TC.ID)
Group by TC.HD_TICKET_ID ) X on ( X.HD_TICKET_ID = HD_TICKET.ID )
inner Join HD_TICKET_CHANGE_FIELD F on ( F.HD_TICKET_CHANGE_ID = X.IDFilho)
inner Join HD_TICKET_CHANGE HTC on ( X.IDFilho = HTC.ID)
where
HD_PRIORITY.ID = HD_PRIORITY_ID
and HD_STATUS.ID = HD_STATUS_ID
and HD_IMPACT.ID = HD_IMPACT_ID
and HD_CATEGORY.ID = HD_CATEGORY_ID
and F.FIELD_CHANGED = 'COMMENT' and
HTC.USER_ID != HD_TICKET.SUBMITTER_ID
group by HD_TICKET.ID
->Active the checkbox to send email
Title:[$id] $title - $estado
Email: EMAIL_SOLICITANTE
Message:
Prezado(a) $solicitante,
Uma nota foi adicionada ao seu chamado:
$comentario
Corpo do chamado:
http://yourservicedeskdirection/adminui/ticket.php?ID=$id
Atenciosamente,
Hope it is useful!!!
Comments