Set-CompleteTask

Prev Next

Summary

Closes a task and marks it complete.

Set-CompleteTask
    -TaskId

Returns a task object.

Parameters

Parameter

Type

Required?

Notes

TaskId

Int32

Yes

The task id.

Examples

Close a task and mark it completed

$task = Set-CompleteTask `
    -TaskId 1123

# Output some information to help indicate that the task is marked completed
Write-Output "The status of task $($task.TaskId) ($($task.Name)) has been set to $($task.StatusDescription)"

# For debug purposes, convert the data to output as JSON so we can see all the fields
Write-Output ""
Write-Output "JSON Results:"

$jsonOutput = $task | ConvertTo-Json -Depth 10

# Output the data
Write-Output $jsonOutput

Execution results:

The status of task 1123 (Monthly KPI Review) has been set to Completed

JSON Results:
{
  "Metadata": null,
  "AssignedBy": null,
  "AssignedTo": null,
  "Client": null,
  "CompletedBy": null,
  "CreatedBy": null,
  "Forms": [],
  "Matter": null,
  "Project": null,
  "QualityCheckPerformedBy": null,
  "Subscribers": [],
  "TaskId": 1123,
  "ProjectId": 2025040000001,
  "ProjectTypeId": 1,
  "ProjectTypeName": "Normal",
  "ProjectTypeDescription": "The normal project type where task work is performed.",
  "ProjectSourceTypeId": 2,
  "ProjectSourceTypeName": "Agility Blue",
  "ProjectDescription": "Automated Reports",
  "ProjectComputedTags": null,
  "ProjectRequesterId": null,
  "ProjectRequesterFirstName": null,
  "ProjectRequesterLastName": null,
  "ProjectRequesterFullName": null,
  "ProjectRequesterEmail": null,
  "MatterId": 107,
  "MatterName": "Automated Reports",
  "MatterReference": null,
  "ClientId": 94,
  "ClientName": "Automation",
  "ClientReference": null,
  "Name": "Monthly KPI Review",
  "AssignedToId": "510e109b-6ff5-4442-9670-cd5e3cd82a7a",
  "AssignedToFullName": "Max Miller",
  "AssignedById": "510e109b-6ff5-4442-9670-cd5e3cd82a7a",
  "AssignedByFullName": "Max Miller",
  "EstimatedHours": null,
  "ActualHours": null,
  "StatusId": 4,
  "StatusDescription": "Completed",
  "QualityCheckStatusId": 2,
  "QualityCheckStatusDescription": "Passed",
  "QualityCheckPerformedById": "510e109b-6ff5-4442-9670-cd5e3cd82a7a",
  "QualityCheckPerformedByFullName": "Max Miller",
  "FormNames": "General Instructions",
  "SortOrder": 0,
  "DateDue": "2025-07-17T12:36:12.9484378+00:00",
  "CompletedOn": "2025-07-16T14:49:08.2880835+00:00",
  "CompletedById": "510e109b-6ff5-4442-9670-cd5e3cd82a7a",
  "CompletedByFullName": "Max Miller",
  "AssignedOn": "2025-07-16T13:22:26.7141506+00:00",
  "NumberOfComments": 0,
  "NumberOfAttachments": 0,
  "NumberOfMediaLogEntries": 0,
  "NumberOfVolumes": 0,
  "NumberOfBillingEntries": 0,
  "NumberOfSubscribers": 0,
  "NumberOfEmailMessages": 0,
  "CreatedByFullName": "Max Miller",
  "CreatedById": "510e109b-6ff5-4442-9670-cd5e3cd82a7a",
  "CreatedOn": "2025-07-15T20:22:07.0068888+00:00",
  "LastUpdatedByFullName": "Max Miller",
  "LastUpdatedById": "510e109b-6ff5-4442-9670-cd5e3cd82a7a",
  "LastUpdatedOn": "2025-07-16T14:49:08.2880835+00:00",
  "LastUpdatedBy": null
}