Re: Audit Attachment SM 9.21 (677 Views)
Reply
Frequent Advisor
VictorHugo
Posts: 93
Registered: ‎09-14-2011
Message 1 of 8 (866 Views)

Audit Attachment SM 9.21

Dear all,

 

I need your help

 

Is it possible to do an audit on attachments, basic informations

 

Who added, when or use a "procedure" that generates a record on "Activities"?

 

Please help me

 

Thank you so very much

___________________
VH
HP Expert
Amen16
Posts: 221
Registered: ‎11-01-2011
Message 2 of 8 (847 Views)

Re: Audit Attachment SM 9.21

Hello Victor,

 

There is actually an Enhancement Request for this that you can check on the following link:

 

http://support.openview.hp.com/selfsolve/document/KM1232242

 

I'll try to find additional information to share with you about this.

 

Regards,

Alex

HP Support

If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution.
Frequent Advisor
VictorHugo
Posts: 93
Registered: ‎09-14-2011
Message 3 of 8 (833 Views)

Re: Audit Attachment SM 9.21

Alex,

 

Thanks for collaboration but when I put my login account I received the following message:

 

You are not authorized to view this document

 

Is there other way to share it?

 

Thanks in advance

___________________
VH
Honored Contributor
Jacob Heubner
Posts: 4,177
Registered: ‎07-21-2008
Message 4 of 8 (821 Views)

Re: Audit Attachment SM 9.21

[ Edited ]

Yeah, this is possible; we built it in our environment though we're logging it an as activity record in each module, instead of an Audit record. I'll share what I did, which might point you in a direction if you truly want this to be on an Audit record.

 

First, we added a script to the ScriptLibrary that gets called whenever an attachment is added to a record or removed from a record (see attached). Basically, the Javascript populates some variables with the name of the attachment, and whether the attachment was added or removed. Then, it checks the Object record for the record where the file is attached to figure out if activities are tracked, and if they are, what table is used to track the activities. Then it simply triggers the sc.activity RAD application to check the activityactions table to determine whether or not to add an activity.

 

Next, we added activityaction records for each modules where we want to track the attachments; for example, in the Incident Management module, we added:

Name: Update Activities

Table: probsummary

Mode: update

Condition: true

 

Name: Attachment Added

Condition: $cg.attachment.added

Description: {"Attachment \""+$cg.attachment.name+"\"" has been added."}

 

Name: Attachment Removed

Condition: $cg.attachment.removed

Description: {"Attachment \""+$cg.attachment.name+"\"" has been removed."}

 

 

Then, we added two triggers on the SYSATTACHMENT table - one for when an attachment is added, one for when it is removed - that calls the script in the Script Library

 

Trigger Name: cg.activity.track.after.add

Table Name: SYSATTACHMENTS

Trigger Type: 2 - After Add

Script -

if (record.segment==0){

  lib.cg_trigger_attachment_activity.add(record)

}

 

--------------

Trigger Name: cg.activity.track.after.delete

Table Name: SYSATTACHMENTS

Trigger Type: 6 - After Delete

Script -

if (record.segment==0){

  lib.cg_trigger_attachment_activity.remove(record)

}

 

 

Honored Contributor
Jacob Heubner
Posts: 4,177
Registered: ‎07-21-2008
Message 5 of 8 (818 Views)

Re: Audit Attachment SM 9.21

[ Edited ]

Forgot to attach my javascript

Script name: cg_trigger_attachment_activity

 

function add(record){
 fileName=record.application
 uniqueId=record.topic
 vars.$cg_attachment_name=record.filename
 var recObject = new SCFile("Object")
 var getObject = recObject.doSelect("file.name=\""+fileName+"\"")
 
 if (getObject==RC_SUCCESS){
  vars.$cg_attachment_added=true
  uniqueField=recObject.unique_field[0]
  
  ticket = new SCFile(fileName)
  getTicket = ticket.doSelect(uniqueField+"=\""+uniqueId+"\"")
  if (getTicket==RC_SUCCESS){
   
   var retCode
   system.functions.rtecall("callrad", retCode, "sc.activity", ["file", "second.file", "text", "record"], [ticket, ticket, "update", recObject], false)
   vars.$cg_attachment_added=""
  }
 }

function remove(record){
 fileName=record.application
 uniqueId=record.topic
 vars.$cg_attachment_name=record.filename
 var recObject = new SCFile("Object")
 var getObject = recObject.doSelect("file.name=\""+fileName+"\"")
 
 if (getObject==RC_SUCCESS){
  vars.$cg_attachment_removed=true
  uniqueField=recObject.unique_field[0]
  
  ticket = new SCFile(fileName)
  getTicket = ticket.doSelect(uniqueField+"=\""+uniqueId+"\"")
  if (getTicket==RC_SUCCESS){
   
   var retCode
   system.functions.rtecall("callrad", retCode, "sc.activity", ["file", "second.file", "text", "record"], [ticket, ticket, "update", recObject], false)
   vars.$cg_attachment_removed=""
  }
 }

Frequent Advisor
redorchid008
Posts: 75
Registered: ‎09-09-2013
Message 6 of 8 (715 Views)

Re: Audit Attachment SM 9.21

Hello Jacob,

 

Sorry for the intervention in the existing thread. But, your solution really workedfor me.

Thanks a ton!!!

But, I need the same thing for updating any attachment also.

This is my client's requirement & I am new in this field. So, pls give me the reply........

 

 

Thanks and Regards,

Avijit Chatterjee

Frequent Advisor
redorchid008
Posts: 75
Registered: ‎09-09-2013
Message 7 of 8 (704 Views)

Re: Audit Attachment SM 9.21

Hello Everybody,

 

Good Evening!!!

Please give me any reply as this is really very urgent for me..

Please reply.....

 

Regards,

Avijit

Trusted Contributor
SanjeevDas
Posts: 387
Registered: ‎06-17-2013
Message 8 of 8 (677 Views)

Re: Audit Attachment SM 9.21

Hi Experts,

 

I am also having the same issue. I am getting stuck while updating any attachment.

 

Please suggest a solution....

 

 

Regards,

Sanjeev

 

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.