Write Audit Log Activity
Overviewβ
The Write Audit Log (write_audit_log) Activity is a useful feature in Pia that allows you to record changes made by the package in the database. With the Write Audit Log Activity, you can define the values you want to store in the database as a part of package change.
The Write Audit Log activity is useful in scenarios where a package has changed user details that needs to be stored in the database for future reference. Another example where this activity may be used is in a Triage Package. You may want to record the actions performed by the package while triaging the ticket such as stamping the tickets with correct classifications and routing to the correct board.
This activity can be located by searching for "Write Audit Log" in the list of activities in the package editor:
Here is a working sample of the activity in a basic package:
# Orchestrator package
conditions:
- name: 'client_filter'
optMode: 'OptOut'
category: 'Testing'
- name: 'chat'
option_button: 'Audit Test'
option_text: 'This is a Test Package'
option_category: 'Test Category'
steps:
- task: chat_interaction
alias: 'audit_test'
inputs:
text: 'This is audit test'
- task: write_audit_log
inputs:
audit_name: 'Test Audit'
value: 'This is a Test Value'
When the package runs, a new audit log will be added in the database with the value defined above. This can also be viewed in the Package Audit Log screen as shown below:
Activity Behaviourβ
The Write Audit Log activity allows you to write custom package audit logs into the database that can also be viewed in Package Audit Log screen. When your package is executed, Pia will run the activity in the background so the user will not be able to see any chat interactivity in the chatbot for this activity.
The Write Audit Log Activity can only be used in package executions which have been initiated via the Pia Chatbot as it required ticket id as an input value (i.e. this activity will not work in cases where the package was initiated via Schedule or Ticketing System Event).
Input Propertiesβ
Use properties to modify the behaviour of the activity.
Property Name: audit_name
Property Required: Yes
Property Description: This is the text to be added as the field name of package audit
Property Name: value
Property Required: No
Property Description: This is to enter the new value to be added in the package audit table. If not value is added, the field is left blank in the package audit table.
Output Propertiesβ
This activity does not have any output properties.