Add-Comment
  • 1 Minute to read
  • Dark
    Light
  • PDF

Add-Comment

  • Dark
    Light
  • PDF

Article summary

Summary

Creates a new comment.

Add-Comment
    -Entry

Returns a comment object.

Parameters

ParameterTypeRequired?Notes
EntryComment ObjectYes

Examples

Create a new comment

# Create a new comment on a specific matter

# This is the object id to create the comment on
# NOTE: Use `Add-TaskComment` for specifically creating task comments
#   1: Client
#   2: Matter
$objectId = 2

# Primary key id is the Id of the object used. In this case, we are associating the comment 
# to matter id 6
$primaryKeyId = 6

# Provide the necessary fields to create the comment
$entry = @{
    ObjectId        = $objectId
    PrimaryKeyId    = $primaryKeyId
    Value           = "This matter was opened on 1/1/2024"
}

# Create the comment. The created entry will be returned back.
$data = Add-Comment -Entry $entry

# Output some information to help indicate that the comment was created
Write-Output "Comment $($data.CommentId) was created on matter $($data.PrimaryKeyId)"

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

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

# Output the data
Write-Output $jsonOutput
Comment 3 was created on matter 6

JSON Results:
{
  "Metadata": null,
  "Object": null,
  "CreatedBy": null,
  "ChildComments": [],
  "CommentId": 3,
  "ObjectId": 2,
  "ObjectName": "Matter",
  "PrimaryKeyId": 6,
  "RelatedCommentId": null,
  "Value": "This matter was opened on 1/1/2024",
  "CreatedByFullName": "Max Miller",
  "CreatedById": "25a34a2f-e3d8-4690-88f5-6b399cf88c4c",
  "CreatedOn": "2024-03-04T15:00:06.1715883+00:00",
  "LastUpdatedByFullName": "Max Miller",
  "LastUpdatedById": "25a34a2f-e3d8-4690-88f5-6b399cf88c4c",
  "LastUpdatedOn": "2024-03-04T15:00:06.1715883+00:00",
  "LastUpdatedBy": null
}

What's Next