/build/static/layout/Breadcrumb_cap_w.png

comments post closure -- need report and notification

I am needing help to create a report that will show all tickets that have a comment AFTER they have been closed.  It would also be nice to be notified when a comment is added to a ticket with status CLOSE.

Thanks,
Jason

0 Comments   [ + ] Show comments

Answers (1)

Posted by: grayematter 10 years ago
5th Degree Black Belt
0
Here is the basis for a report.  I have arbitrarily limited the results to comments posted within the last 31 days.  You should be able to easily convert this to a ticket rule as well.

select 
    HD_TICKET.ID,
    HD_TICKET.TITLE,
    HD_TICKET_CHANGE.COMMENT,
    HD_TICKET_CHANGE.DESCRIPTION,
    HD_TICKET_CHANGE.TIMESTAMP,
    HD_TICKET.TIME_CLOSED,
    ifnull((select 
                    FULL_NAME
                from
                    USER
                where
                    HD_TICKET.OWNER_ID = USER.ID),
            ' Unassigned') as OWNER_NAME,
    (select 
            FULL_NAME
        from
            USER
        where
            HD_TICKET.SUBMITTER_ID = USER.ID) as SUBMITTER_NAME
from
    HD_TICKET_CHANGE
left join
    HD_TICKET ON HD_TICKET_CHANGE.HD_TICKET_ID = HD_TICKET.ID
        left join
    HD_CATEGORY ON HD_CATEGORY_ID = HD_CATEGORY.ID
        left join
    HD_STATUS ON HD_STATUS_ID = HD_STATUS.ID
        left join
    HD_PRIORITY ON HD_PRIORITY_ID = HD_PRIORITY.ID
        left join
    HD_IMPACT ON HD_IMPACT_ID = HD_IMPACT.ID
        left join
    MACHINE ON HD_TICKET.MACHINE_ID = MACHINE.ID
where
    HD_STATUS.STATE = 'closed'
    and HD_TICKET_CHANGE.TIMESTAMP > HD_TICKET.TIME_CLOSED
    and (HD_TICKET_CHANGE.COMMENT IS NOT NULL and HD_TICKET_CHANGE.COMMENT <> '')
    and HD_TICKET_CHANGE.TIMESTAMP > DATE_SUB(NOW(), INTERVAL 31 DAY)
ORDER BY HD_TICKET.ID, HD_TICKET_CHANGE.ID

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

Share

 
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