Set-Comment
- 1 Minute to read
- Print
- DarkLight
- PDF
Set-Comment
- 1 Minute to read
- Print
- DarkLight
- PDF
Article summary
Did you find this summary helpful?
Thank you for your feedback
Summary
Updates an existing comment.
Set-Comment
-Entry
Returns a comment object.
Parameters
Parameter | Type | Required? | Notes |
---|---|---|---|
Entry | Comment Object | Yes |
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
}