Activities on ci records.

Pravallika9
Tera Expert

Hi
My ci records are getting created via integration from client side.
So while inserting and developing the relationships some kind of activities are recorded and shown in activites.
How to find from where exactly the activities are recorded.
Initially there are some BR's from where the audit date and last audit date has been changed but when I disabled those BR's also i am able to see those activities.
I want to avoid certain things to be shown in activities in ci form how to proceed?

 

Pravallika9_0-1686817071453.png

 

added and removed, audit date activties I dont want to be seen. How to do

 

3 REPLIES 3

Manmohan K
Tera Sage

Hi @Pravallika9 

 

These can come from Business rules, Scripted Rest APIs , Script Includes, Flow or Workflow

So there are lots of places you have to search to find the code responsible for it

Hi @Manmohan K 
I did search all those things.
I got few BR's which might trigger them so for debugging I have disabled them and check---so ruled out
Same way I checked for scripted apis and script includes.
But in work flow I didnt find any workflow attached to this table so I ruled this out.

 

Riya Verma
Kilo Sage

HI @Pravallika9 ,

 

Hope you are doing great.

To identify the source of these activities:

  1. Review Integration Configuration: Check if there are any specific event handlers or scripts associated with the CI creation process.

  2. Debugging the BRs associated.

  3. Conditional Activity Logging: To avoid certain actions from being logged as activities in the CI form, you can customize the activity logging behavior. ServiceNow provides an API called GlideAudit. By utilizing this API, you can write custom scripts that define the conditions under which activities should be logged. You can incorporate these scripts within the BRs or associated scripts to control the logging behavior.

  4. Customize Audit Logs: ServiceNow provides an Audit Log feature that captures changes made to records. To exclude specific fields, like audit date activities, from being recorded in the activity log, you can modify the auditing configuration for the CI table.

disable auditing for specific fields using a business rule script:

// Disable auditing for certain fields
var auditFields = ['field1', 'field2', 'audit_date'];
for (var i = 0; i < auditFields.length; i++) {
  gs.getProperty('glide.db.audit_fields').push(auditFields[i]);
}

 

Please mark the appropriate response as correct answer and helpful, This may help other community users to follow correct solution.
Regards,
Riya Verma