Create task

createTask(projectReference: String!, input: CreateTaskInput!): TaskSource!

Requires project.runs.write.

Arguments

ArgumentTypeRequired
projectReferenceString!Yes
inputCreateTaskInput!Yes

Input fields

input

CreateTaskInput

FieldTypeRequiredDescription
idString!YesBecomes the file name and the task id.
nameString!Yes
descriptionStringNo
schedulableBooleanNoWhether a schedule can start the task; default true.
sourceTargetKindWriteTargetKindNoThe source to write; default project.
targetBranchIdIDNoRequired with the kind preview_branch.

Response

Returns TaskSource!. Open the type for its fields and nested types.

FieldTypeDescription
idID!
nameString!
descriptionString
targetString!
sourcePathString!
sourceString!The source text of the task file.
schedulableBoolean!
editModeTaskEditMode!

All fields of TaskSource.

Types marked with ! cannot be null. Lists use [Type] notation. The type index lists all published input and response types.

Example

query.graphql
mutation CreateTask($projectReference: String!, $input: CreateTaskInput!) {  createTask(projectReference: $projectReference, input: $input) {    id    name    description    editMode    schedulable  }}
variables.json
{  "projectReference": "00000000-0000-4000-8000-000000000001",  "input": {    "id": "example",    "name": "example"  }}