Get-HistoryEntry

Prev Next

Summary

Retrieves an existing history entry.

Get-HistoryEntry
    -Id

Returns a history entry object.

Parameters

Parameter

Type

Required?

Notes

Id

Int32

Yes

The history entry id.

Heads up!

The history entry object contains the following two fields that contain GZip-compressed binary data:

  • NewObjectCompressed

  • OldObjectCompressed

To extract the object states from these fields, pipe the ConvertFrom-GZipCompressedData utility cmdlet:

$newObjectState = $historyEntry.NewObjectCompressed | ConvertFrom-GZipCompressedData

Examples

Get an existing history entry

This example retrieves a specific history entry and outputs it as JSON.

# Retrieve a specific history entry by id
$entry = Get-HistoryEntry -Id 20534

Write-Output "Retrieved history entry #$($entry.HistoryId): $($entry.Description)"

$decompressedObject = $entry.NewObjectCompressed | ConvertFrom-GZipCompressedData | ConvertTo-Json -Depth 10

Write-Output "Decompressed New Object State:"
Write-Output $decompressedObject

# For debug purposes, convert the entity to output as JSON so we can see the available fields
Write-Output ""
Write-Output "JSON Results:"

$jsonOutput = $entry | ConvertTo-Json -Depth 10

# Output the entity
Write-Output $jsonOutput

Execution results:

Retrieved history entry #20534: Max Miller created matter "AGM vs. MGM Review"
Decompressed New Object State:
{
  "Name": "AGM vs. MGM Review",
  "Fields": [],
  "LastUpdatedOn": "2025-12-24T14:58:15.0981224+00:00",
  "DefaultContactId": null,
  "NumberOfTasks": 0,
  "CreatedBy": null,
  "AccessStateName": null,
  "Active": true,
  "Client": null,
  "DefaultContactFullName": null,
  "NumberOfMediaLogEntries": 0,
  "FirstProjectCreatedOnDate": null,
  "MatterId": 111,
  "ClientName": "AGM Widget Corporation",
  "IsFavorite": false,
  "CreatedOn": "2025-12-24T14:58:15.0981224+00:00",
  "ClientReference": "1024",
  "CreatedByFullName": "Max Miller",
  "NumberOfProjects": 0,
  "ClientId": 29,
  "AccessStateId": null,
  "NumberOfComments": 0,
  "LastUpdatedById": "510e109b-6ff5-4442-9670-cd5e3cd82a7a",
  "DefaultContact": null,
  "LastUpdatedByFullName": "Max Miller",
  "CreatedById": "510e109b-6ff5-4442-9670-cd5e3cd82a7a",
  "Reference": null,
  "NumberOfBillingEntries": 0,
  "LastUpdatedBy": null,
  "LastProjectCreatedOnDate": null,
  "NumberOfVolumes": 0
}

JSON Results:
{
  "HistoryId": 20534,
  "HistoryTypeId": 2,
  "HistoryTypeName": "Create",
  "HistoryType": null,
  "HistoryTableId": 6,
  "HistoryTableName": "Matter",
  "HistoryTable": null,
  "PrimaryKeyAsNumber": 111,
  "PrimaryKeyAsString": null,
  "Description": "Max Miller created matter \"AGM vs. MGM Review\"",
  "Timestamp": "2025-12-24T14:58:15.173Z",
  "UserId": "510e109b-6ff5-4442-9670-cd5e3cd82a7a",
  "User": null,
  "UserFullName": "Max Miller",
  "NewObject": null,
  "OldObject": null,
  "NewObjectCompressed": [
    31,
    // removed the rest of the binary representation for readability
  ],
  "OldObjectCompressed": null,
  "UsesCompression": true
}