/build/static/layout/Breadcrumb_cap_w.png

HD_TICKET.TIME_CLOSED field simplified?

Hello,

We are creating a new ticket rule that will kick in only if users reply to a closed ticket.

That, so far, works fine. However, we'd like to add to our email response when (date) the ticket was closed. We incorporate "HD_TICKET.TIME_CLOSED" and the formatted result is "2024-08-08 00:19:59". 

Our question is, is there a way to simplify the date format to be "user-friendly?" maybe just the date and omit time?

Here is our SQL:

select distinct HD_TICKET.ID, 
                       HD_TICKET.OWNER_ID as OWNER_ID, 
                       HD_TICKET.ID as TICKNUM,
                       HD_TICKET.TIME_CLOSED as date_closed,
                       HD_TICKET.TITLE,
                       HD_STATUS.NAME AS STATUS_NAME,
                       HD_STATUS.STATE as STATE,
                       HD_TICKET_CHANGE.COMMENT as last_comment,
                       OWNER.USER_NAME as OWNER_NAME,
                       OWNER.FULL_NAME as OWNER_FULLNAME,
                       OWNER.EMAIL as OWNER_EMAIL,
                       UPDATER.USER_NAME as UPDATERNAME,
                       UPDATER.FULL_NAME as UPDATER_FULLNAME,
                       UPDATER.EMAIL as UPDATEREMAIL
                  from (HD_TICKET, HD_STATUS)
             left join HD_TICKET_CHANGE on HD_TICKET_CHANGE.ID = <CHANGE_ID>
             left join HD_TICKET_CHANGE_FIELD on HD_TICKET_CHANGE_FIELD.HD_TICKET_CHANGE_ID = HD_TICKET_CHANGE.ID
             left join USER OWNER on OWNER.ID = HD_TICKET.OWNER_ID
             left join USER UPDATER on UPDATER.ID = HD_TICKET_CHANGE.USER_ID
                 where HD_STATUS.ID = HD_TICKET.HD_STATUS_ID
                   and HD_TICKET_CHANGE.HD_TICKET_ID= HD_TICKET.ID
                   and HD_TICKET_CHANGE_FIELD.FIELD_CHANGED !='SATISFACTION_RATING'
                   and HD_TICKET_CHANGE_FIELD.FIELD_CHANGED !='SATISFACTION_COMMENT'
                   and HD_STATUS.STATE = 'closed' 
                   and (UPDATER.ID <> OWNER.ID or OWNER.ID is NULL) 
                   and (UPDATER.ID= HD_TICKET.SUBMITTER_ID)  

We don't need to update the query; we send an email back to the user something like:

 "Hey, your ticket was closed on this day: $date_closed"


Any help is appreciated!
Thanks.


0 Comments   [ + ] Show comments

Answers (0)

Be the first to answer this question

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ