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

Get-TaskComment

  • Dark
    Light
  • PDF

Article summary

Summary

Retrieves an existing task comment.

Get-TaskComment
    -Id
    -IncludeTask

Returns a task comment object.

Parameters

ParameterTypeRequired?Notes
IdInt32YesThe task comment id.
IncludeTaskSwitchNo, Defaults to falseIncludes the parent task property.

Examples

Get an existing task comment

This example retrieves a specific task comment and outputs it as JSON.

# Retrieve a specific task comment by id
$data = Get-TaskComment -Id 5

Write-Output "Retrieved task comment $($data.TaskCommentId)"

# Convert the data to output as JSON
$jsonOutput = $data | ConvertTo-Json -Depth 10

# 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

Write-Output $jsonOutput

Results of executing the script:

Retrieved task comment 5

JSON Results:
{
  "Metadata": null,
  "Task": null,
  "CreatedBy": null,
  "ChildComments": [],
  "TaskCommentId": 5,
  "TaskId": 8,
  "TaskName": "Process Data",
  "RelatedTaskCommentId": null,
  "Value": "<p>I began to upload this data this morning.</p><p><strong>Notice</strong>: Windows says it will take about 3 hours to finish copying</p>",
  "CommentTypeId": 1,
  "CommentTypeName": "General",
  "IsBlocking": false,
  "IsQCRelated": false,
  "IsExternal": false,
  "CreatedByFullName": "Max Miller",
  "CreatedById": "25a34a2f-e3d8-4690-88f5-6b399cf88c4c",
  "CreatedOn": "2015-09-09T10:35:11.9798302-05:00",
  "LastUpdatedByFullName": "Max Miller",
  "LastUpdatedById": "25a34a2f-e3d8-4690-88f5-6b399cf88c4c",
  "LastUpdatedOn": "2015-09-09T10:35:11.9798302-05:00",
  "LastUpdatedBy": null
}