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