This report is used to view the historical details of Approved and Denied approval processes and their individual steps.
We can also use this report to display all details for which an approval decision is pending.
To make any changes to a query, refer to the KB article below.
SELECT wo.WORKORDERID as "Request ID",
aau.FIRST_NAME as "Requester",
wo.TITLE as "Subject",
ti.FIRST_NAME as "Technician",
qd.QUEUENAME as "Group",
std.STATUSNAME as "Request Status",
longtodate(wo.CREATEDTIME) as "Created Time",
app_level.name "Level name",
asd.statusname AS "Approval Status",
LONGTODATE(app_details.SENT_TIME) AS "Approval Sent date",
LONGTODATE(app_details.ACTION_DATE) AS "Approved Date",
approver.FIRST_NAME "Approver Name",
app_details.EMAIL "Approver Email",
app_details.COMMENTS as "Approver Comments" 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 WorkOrder_Queue woq ON wo.WORKORDERID=woq.WORKORDERID
LEFT JOIN QueueDefinition qd ON woq.QUEUEID=qd.QUEUEID
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 Request_ApprovalLevel req_app_level on req_app_level.entityid=wo.WORKORDERID
LEFT JOIN Approvallevel app_level on req_app_level.levelid = app_level.id
LEFT JOIN ApprovalDetails app_details on app_details.approval_level_id = app_level.id
LEFT JOIN ApprovalStatusDefinition asd on asd.STATUSID=app_details.STATUSID
LEFT JOIN AaaUser approver ON app_details.approverid=approver.USER_ID
WHERE wo.ISPARENT='1'
and wo.createdtime >= datetolong('2023-01-01 00:00:00')
and wo.createdtime <= datetolong('2023-12-31 23:59:59')
Note : Login to ServiceDesk Plus, go to Reports tab > New Query Report > Copy the query to the query editor and run the report.