Status change from history

Status change from history

This report is used to find who changed the status

SELECT wo.WORKORDERID "Request ID",
       aau.FIRST_NAME "Requester",
       std.STATUSNAME "Request Status",
       wo.TITLE "Subject",
       woh.OPERATION "Operation",
       LONGTODATE(wo.CREATEDTIME) CREATEDTIME,
       aau1.FIRST_NAME PERFORMEDBY,
       LONGTODATE(OPERATIONTIME) OPERATIONTIME,
       std1.STATUSNAME "Changed From",
       std2.STATUSNAME"Changed To" 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 StatusDefinition std ON wos.STATUSID=std.STATUSID
LEFT JOIN WorkOrderHistory woh ON wo.WORKORDERID = woh.WORKORDERID
LEFT JOIN WorkOrderHistoryDiff wohd ON woh.HISTORYID = wohd.HISTORYID
LEFT JOIN AaaUser aau1 ON aau1.USER_ID = woh.OPERATIONOWNERID
LEFT JOIN StatusDefinition std1 ON cast(cast(wohd.prev_value AS varchar) AS int) =std1.STATUSID
LEFT JOIN StatusDefinition std2 ON cast(cast(wohd.current_value AS varchar) AS int) =std2.STATUSID
WHERE wohd.COLUMNNAME IN ('STATUSID')
  AND wo.CREATEDTIME >= <from_thisweek>
  AND wo.CREATEDTIME <= <to_thisweek>
ORDER BY 1,
         OPERATIONTIME DESC
 

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

                    • Change Status history

                      SELECT chdt.changeid                       "Change ID",         chdt.title                          "Title",         orgaaa.first_name                   "Requested by",         ownaaa.first_name                   "Technician",  ...
                    • Query to retrieve users login and logout history and find their current status

                      REQUIREMENT: To generate a report that contains the login and logout history of users and to determine the current user status. TESTED IN: Builds 14503 (Postgres) QUERY 1: The following query provides the login and logout history of users. SELECT ...
                    • Change stage history

                      SELECT chdt.changeid                       "Change ID",         chdt.title                          "Title",         orgaaa.first_name                   "Requested by",         ownaaa.first_name                   "Technician",  ...
                    • Script to bulk close change using deluge script based on the status

                      The following script will help you bulk close changes based on the status of change using custom schedules 1. Go to Reports tab --> New query report --> copy the query to the query editor and run the report. Save the report in the folder. The query ...
                    • Technician change from history

                      This report is used to find who changed the Technician and how many technician handled the request.  To make any changes to a query, refer to the KB article below. ...