Audit if someone just opens a ticket

Brian Lancaster
Tera Sage

Is there a way to have an audit record if someone just opens a incident or request / task?

12 REPLIES 12

jonnyseymour
ServiceNow Employee
ServiceNow Employee

Brian.



ServiceNow is very flexible and you can create workflow/scripting to achieve that record keeping activity (e.g. insert a record into a table of the user and form accessed).


The OOTB auditing is targetted to changes on a table (auditing tracks the creation, update, and deletion of audited records).



More information here:


* Script in ServiceNow - ServiceNow Wiki: http://bit.ly/1MhEXkW


* Turning on Auditing (History) for a Table - ServiceNow Wiki: http://bit.ly/1IH3SKc


Hello Jonny,


Can you provide the full wiki links?   Out security department blocks the use of short links.


David OBrien
Kilo Guru

You could use a Display business rule that runs when a record is displayed to achieve this. What I would probably do is create a new journal field for tracking 'views' and then add notes into that field in your Display business rule. In the example below, I just put the notes into Work Notes.   This will update the record each time the form is viewed and show in the audit logs for that record.



function onDisplay(current, g_scratchpad) {


  //This function will be automatically called when this rule is processed.


  current.work_notes = 'Record viewed by ' gs.getUser.name;


  current.update();


}


bernyalvarado
Mega Sage

Hi Brian, there's an out of the box event that you could use which is user.view, and per event it will have the following information:



a) the table that was viewed


b) the sys_id of the record that was viewed


c) the sys_id of the user that viewed the record


d) the name of the user that viewed the record


e) the time on which the record was viewed.


f) the actual url of the record viewed



I hope this is helpful!



Thanks,


Berny