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

Set-Comment

  • Dark
    Light
  • PDF

Article summary

Summary

Updates an existing comment.

Set-Comment
    -Entry

Returns a comment object.

Parameters

ParameterTypeRequired?Notes
EntryComment ObjectYes

Examples

Update an existing comment

# Update an existing comment

# A common flow for updating existing data is to first retrieve the data using the GET
# command, update specific fields, and then provide the modified data back to the SET command.

$entry = Get-Comment -Id 3

# In this example, we want to update the comment value:
$entry.Value = "Correction: This matter was opened up on 1/14/2024"

# Update the comment. The updated entry will be returned back.
$data = Set-Comment -Entry $entry

# Output some information to help indicate that the comment was updated
Write-Output "Comment $($data.CommentId) was updated 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 updated on matter 6

JSON Results:
{
  "Metadata": null,
  "Object": null,
  "CreatedBy": null,
  "ChildComments": [],
  "CommentId": 3,
  "ObjectId": 2,
  "ObjectName": "Matter",
  "PrimaryKeyId": 6,
  "RelatedCommentId": null,
  "Value": "Correction: This matter was opened up on 1/14/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:10:28.3143102+00:00",
  "LastUpdatedBy": null
}

What's Next