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

Set-TaskComment

  • Dark
    Light
  • PDF

Article summary

Summary

Updates an existing task comment.

Set-TaskComment
    -Entry
    -IncludeTask

Returns a task comment object.

Parameters

ParameterTypeRequired?Notes
EntryTask Comment ObjectYes
IncludeTaskSwitchNo, Defaults to falseIncludes the parent task property.

Examples

Update an existing task comment

# Update an existing task 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-TaskComment -Id 935

# In this example, we want to update the "IsQCRelated" property to true:
$entry.IsQCRelated = $true

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

# Output some information to help indicate that the comment was updated
Write-Output "Task Comment $($data.TaskCommentId) was updated on task $($data.TaskId)"

# 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

Results of executing the script:

Task Comment 935 was updated on task 966

JSON Results:
{
  "Metadata": null,
  "Task": null,
  "CreatedBy": null,
  "ChildComments": [],
  "TaskCommentId": 935,
  "TaskId": 966,
  "TaskName": "Processing QC",
  "RelatedTaskCommentId": null,
  "Value": "QC completed without any issues.",
  "CommentTypeId": 1,
  "CommentTypeName": "General",
  "IsBlocking": false,
  "IsQCRelated": true,
  "IsExternal": false,
  "CreatedByFullName": "Max Miller",
  "CreatedById": "25a34a2f-e3d8-4690-88f5-6b399cf88c4c",
  "CreatedOn": "2024-03-04T20:06:40.3018202+00:00",
  "LastUpdatedByFullName": "Max Miller",
  "LastUpdatedById": "25a34a2f-e3d8-4690-88f5-6b399cf88c4c",
  "LastUpdatedOn": "2024-03-04T20:14:16.6756302+00:00",
  "LastUpdatedBy": null
}