Question & Answer
How to email the lastest Work Log for a Ticket record using a communication template.
1. In order to get the latest Work Log record of a ticket, a relationship between the TICKET and WORKLOG objects needs to be created.
- Go to the Database Configuration application
- Select the 'TICKET' object
- Go to the Relationships tab
- Create a new relationship called as 'TKWORKLOG'
In Child Object , enter WORKLOG
In Where Clause, enter the following:
RECORDKEY=:TICKETID AND CLASS=:CLASS AND WORKLOGID IN ( SELECT WORKLOGID FROM WORKLOG WHERE CREATEDATE = ( SELECT MAX(CREATEDATE) FROM WORKLOG WHERE RECORDKEY= :TICKETID AND CLASS=:CLASS ))
- Save the record.
2. Create a Communication Template.
Applies To : SR
Message : Problem ID :TICKETID
Summary of problem: :DESCRIPTION
Problem description: :DESCRIPTION_LONGDESCRIPTION
Worklog description Summary- :TKWORKLOG.DESCRIPTION
Worklog Description Details- :TKWORKLOG.DESCRIPTION_LONGDESCRIPTION
- Change Status to ACTIVE
<< Result >>
There are 3 Work Logs for SR 1001 .
When sending an email using the Communication Template above, the latest Work Log ( ex. WorkLog3 ) would be sent.
17 June 2018