--- title: "Add-Task" slug: "scripting-add-task" updated: 2025-07-16T12:24:05Z published: 2025-07-16T12:24:05Z canonical: "help.agilityblue.com/scripting-add-task" --- > ## Documentation Index > Fetch the complete documentation index at: https://help.agilityblue.com/llms.txt > Use this file to discover all available pages before exploring further. # Add-Task ## Summary Creates a new task. ```powershell Add-Task    -Entry ``` Returns a [task](https://apidocs.agilityblue.com/#7188f9cc-69d1-4f96-818f-bb8b2d08e739) object. > [!NOTE] > Additional Details > > Check out the [Concepts: Tasks & Task Forms](/v1/docs/scripting-tutorials-tasks-and-task-forms) article for more detailed information about tasks. ## Parameters | Parameter | Type | Required? | Notes | | --- | --- | --- | --- | | Entry | [Task](https://apidocs.agilityblue.com/#7188f9cc-69d1-4f96-818f-bb8b2d08e739) Object | Yes | The task used to create a new entry. | ## Examples ### Create a new task ```powershell # Create a new "General Instructions" task using only required fields $entry = @{    Name = "Monthly KPI Review"    ProjectId = 2025040000001    Forms = @(        @{            FormId = 1            Name = "General Instructions"            Sections = @(                @{                    FormSectionId = 1                    Fields = @(                        @{                            FieldId = 1                            Label = "Instructions"                            ValueAsString = "Please run the monthly KPI reports and return them to management."                        }                    )                }            )        }    ) } # Create the task. The created entry will be returned back, but won't contain the forms. $data = Add-Task -Entry $entry # Retrieve the task with forms so we can write an output message that includes them $data = Get-Task -Id $data.TaskId -IncludeForms # Output some information to help indicate that the task was created Write-Output "Task $($data.TaskId) ($($data.Name)) was created" # 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 ``` Execution results: ```json Task 1123 (Monthly KPI Review) was created JSON Results: {  "Metadata": null,  "AssignedBy": null,  "AssignedTo": null,  "Client": null,  "CompletedBy": null,  "CreatedBy": null,  "Forms": [    {      "TaskFormId": 1219,      "TaskId": 1123,      "FormId": 1,      "Guid": 1752610927023,      "Name": "General Instructions",      "Sections": [        {          "TaskFormSectionId": 1434,          "FormSectionId": null,          "TaskFormId": 1219,          "Heading": null,          "Position": 0,          "Guid": 1,          "Fields": [            {              "TaskFormFieldId": 5387,              "FieldId": 1,              "TaskFormSectionId": 1434,              "DataTypeId": 2,              "DataTypeName": "Rich Text",              "Label": "Instructions",              "ValueAsString": "Please run the monthly KPI reports and return them to management.",              "ValueAsBoolean": null,              "ValueAsNumber": null,              "ValueAsDecimal": null,              "ValueAsDate": null,              "DefaultValue": null,              "IsRequired": false,              "IsVisible": true,              "Position": 0,              "Guid": 1,              "ReferenceObject": null,              "AppliedProperties": []            }          ]        }      ]    }  ],  "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": null,  "AssignedToFullName": null,  "AssignedById": null,  "AssignedByFullName": null,  "EstimatedHours": null,  "ActualHours": null,  "StatusId": 1,  "StatusDescription": "New",  "QualityCheckStatusId": 1,  "QualityCheckStatusDescription": "Not Performed",  "QualityCheckPerformedById": null,  "QualityCheckPerformedByFullName": null,  "FormNames": "General Instructions",  "SortOrder": 0,  "DateDue": null,  "CompletedOn": null,  "CompletedById": null,  "CompletedByFullName": null,  "AssignedOn": null,  "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-15T20:22:07.0068888+00:00",  "LastUpdatedBy": null } ```