Last reply by from technician or requester

Last reply by from technician or requester

This report gives the last Conversation of Technician and requester.  


SELECT wo.WORKORDERID "Request ID",
       max(aau.FIRST_NAME) "Requester",
       max(wo.TITLE) "Subject",
       max(ti.FIRST_NAME) "Technician",
       longtodate(max(wo.CREATEDTIME)) "Created Time",
       CASE
           WHEN max(wos.notificationstatus) = 'REQ_REPLY' THEN max(c.description)
           WHEN max(wos.notificationstatus) = 'TECH_REPLY' THEN max(n.description)
           ELSE NULL
       END "Last conversation" FROM WorkOrder wo
LEFT JOIN SDUser sdu ON wo.REQUESTERID=sdu.USERID
LEFT JOIN AaaUser aau ON sdu.USERID=aau.USER_ID
LEFT JOIN WorkOrderStates wos ON wo.WORKORDERID=wos.WORKORDERID
LEFT JOIN SDUser td ON wos.OWNERID=td.USERID
LEFT JOIN AaaUser ti ON td.USERID=ti.USER_ID
LEFT JOIN StatusDefinition std ON wos.STATUSID=std.STATUSID
LEFT JOIN
  (SELECT con.workorderid,
          cond.description FROM conversation con
   LEFT JOIN aaauser au1 ON con.requesterid=au1.user_id
   LEFT JOIN conversationdescription cond ON con.CONVERSATIONID= cond.CONVERSATIONID) c ON c.workorderid=wo.workorderid
LEFT JOIN
  (SELECT nw.workorderid,
          nod.description FROM notify_workorder nw
   LEFT JOIN notification NO ON nw.notificationid=no.notificationid
   LEFT JOIN aaauser au2 ON no.senderid=au2.user_id
   LEFT JOIN notificationtodesc nod ON no.NOTIFICATIONID=nod.NOTIFICATIONID
   WHERE no.senderid !=1) n ON n.workorderid=wo.workorderid
WHERE std.ispending='1'
GROUP BY wo.WORKORDERID

 

Note : Login to ServiceDesk Plus, go to Reports tab > New Query Report > Copy the query to the query editor and run the report. 

                  New to ADSelfService Plus?

                    • Related Articles

                    • Update Request Status upon Receiving a New Reply from Technician

                      Use case: When a technician works on a request, there might be incidents where he might need additional information from the requester. In such cases, when the technician replies to the customer the ticket status should be changed to "On-Hold". Steps ...
                    • Query to show last conversation and last notification in a request ( MSSQL )

                      Tested in Build MSSQL (14306) Query SELECT wo.WORKORDERID "Request ID", aau.FIRST_NAME "Requester", wo.TITLE "Subject", ti.FIRST_NAME "Technician", longtodate(wo.CREATEDTIME) "Created Time", (select conversationdescription.description from ...
                    • Converting a requester to a technician

                      Please follow the below steps to convert a requester to a technician. Step 1 (If the requester is already added under MSP Requester): 1) Log in as an administrator. 2) Go to Admin tab>>MSP Details>>MSP Requester(Left hand column). 3) Click on the ...
                    • Query to show the last worklog added in a ticket (PGSQL)

                      Tested in build PGSQL (14300) PGSQL: SELECT wo.WORKORDERID "Request ID", max(aau.FIRST_NAME) "Requester", max(wo.TITLE) "Subject", max(qd.QUEUENAME) "Group", max(ti.FIRST_NAME) "Assigned Technician", CAST(ct.TIMESPENT AS FLOAT)/1000/3600 AS "Time ...
                    • Query to show Last added worklog of a ticket ( MSSQL )

                      Tested in build MSSQL (14306) MSSQL: SELECT wo.WORKORDERID AS "Ticket Number", pd.PRIORITYNAME AS "Priority", cd.CATEGORYNAME AS "Category", qd.QUEUENAME AS "Group", ti.FIRST_NAME AS "Technician", aau.FIRST_NAME AS "Requester", Wo.title "Subject", ...