Quantcast
Channel: All Quality Center / ALM Practitioners Forum posts
Viewing all articles
Browse latest Browse all 14708

Re: Add audit log in custom email Body

$
0
0

TDConnection object has AuditRecord and AuditProperty objects from which you can retrieve the audit log. I assumed AuditRecord.AuditPropertyfactory will return just one audit property record since there is an one to one mapping between audit record and audit property tables, however this retrieves all audit properties regardless of audit record (i might be mistaken). So i have used action ID in filter condition.

 

Set arf = TDConnection.AuditRecordFactory
Set afr = arf.Filter
afr.Filter("AU_ENTITY_TYPE") = "BUG"
afr.Filter("AU_ENTITY_ID") = Bug_Fields.Field("BG_BUG_ID").Value
Set alst = afr.NewList
For Each ar In alst
  Set apf = ar.AuditPropertyFactory
  Set propfltr = apf.Filter
  propfltr.Filter("AP_FIELD_NAME") = "BG_STATUS"
  propfltr.Filter("AP_ACTION_ID") = ar.actionID
  Set propList = propfltr.NewList
  For Each ap In propList
    Msgbox ap.FieldName & " was changed from " & ap.oldValue & " to " & ap.newValue
  Next
Next

 


Viewing all articles
Browse latest Browse all 14708

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>