cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

Document History Export (audit trail)

dremmers
10-Marble

Document History Export (audit trail)

Hi All,

 

I´d like to export history information (audit trail) of a document. To be more precise the information present in the tab "history" within the item details of each ID within a document. 

One obstacle would be gathering the history-tab information of all IDs. An issue that I assume we can overcome by configuring a report - given that this information is accessible and exportable at all(?).

 

Did any of you ever exported this kind of information?

I already tried using the web GUI attempting to export the history information there - unfortunately without  success so far.

 

Best regards and big thanks upfront to whoever will be able to help me here 

Daniel

2 REPLIES 2

Hi Daniel,

 

This seems pretty tricky. You could do this via API calls to read the data, or through some clever shell scripting if you have familiarity with that.

 

You can start by issuing an "im viewsegment [Document ID]" command to get the data returned for the document like so:

 

Response:
  App. Name    = im
  Command Name = viewsegment
  Work Item:
    Id         = 921
    Context    = NULL
    Model Type = im.Issue.segment
    Field:
      Name      = Section
      Data Type = wchar_t *
      Value     =
    Field:
      Name      = Category
      Data Type = NULL
      Value     = NULL
    Field:
      Name      = Reference Mode
      Data Type = NULL
      Value     = NULL
    Field:
      Name      = ALM_Text
      Data Type = NULL
      Value     = NULL
    Field:
      Name      = ID
      Data Type = int
      Value     = 921
    Field:
      Name      = Document ID
      Data Type = int
      Value     = 921
  Work Item:
    Id         = 922
    Context    = NULL
    Model Type = im.Issue.content
    Field:
      Name      = Section
      Data Type = wchar_t *
      Value     = 1
    Field:
      Name      = Category
      Data Type = wchar_t *
      Value     = Functional Requirement
    Field:
      Name      = Reference Mode
      Data Type = wchar_t *
      Value     = Author
    Field:
      Name      = ALM_Text
      Data Type = wchar_t *
      Value     = Parameter is: {{ProjectParam}}
    Field:
      Name      = ID
      Data Type = int
      Value     = 922
    Field:
      Name      = Document ID
      Data Type = int
      Value     = 921
... and so on

 

From that output, the important points are the ID field entries. You can feed those to a set of "im viewissue --showhistory [ID]" commands (using the CLI or API). This will give you a listing of the current field values but also include a section where the history is displayed:

 

History: 
Modified by: joe on Fri Aug 10 09:28:16 EDT 2018
Modified Fields:
State [Children]: "ALM_Active, ALM_Active, ALM_Active, ALM_Active, ALM_Active"

Modified by: joe on Thu Apr 26 13:45:24 EDT 2018
Modified Fields:
Additional Comments:  zcvzczcxv
... and so on

 

Not exactly an elegant solution but should get you the information which you can then parse with scripts and such.

Hi Joe,

 

great thanks for your insights. I checked your approach and it works!!

As you say - not quite elegant - but with parser and some data organization scrips this might be the way to go.

 

Thanks again and cheers

Daniel

Top Tags