Skip to content

Using the ConnectWise Manage audit trail

I had a case where I had to provide before and after data from the audit trail in our Manage instance. I put together a short query that will give you the before and after data. It also includes the username of the last updater of the company as well as the timestamp.

Look in the Locale_Key table for the different types of changes that the audit log will store. 2730 is listed as “company_details_Owner_Level_RecID_change”. Just change that number to the field you wish to report on.

SELECT co.company_name, ca.updated_by, ca.last_updated_utc, cav1.audit_value AS 'Original', cav2.audit_value AS 'Changed'
FROM Company co, Company_Audit ca, Audit_Type at, Locale_Key lk, Company_Audit_Value cav1, Company_Audit_Value cav2
WHERE co.company_recid = ca.company_recid
AND ca.audit_type_recid = at.audit_type_recid
AND at.locale_key_recid = lk.locale_key_recid
AND ca.locale_key_recid = 2730
AND cav1.company_audit_recid = ca.company_audit_recid
AND cav2.company_audit_recid = ca.company_audit_recid
AND cav1.audit_token = 'old_value'
AND cav2.audit_token = 'new_value'
ORDER BY ca.last_updated_utc

 

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *