Read task source

taskSource(projectReference: String!, taskId: String!, input: SourceReadSelectorInput): TaskSource!

Requires project.runs.read.

Arguments

ArgumentTypeRequired
projectReferenceString!Yes
taskIdString!Yes
inputSourceReadSelectorInputNo

Input fields

input

SourceReadSelectorInput

FieldTypeRequiredDescription
sourceTargetKindWriteTargetKindNoThe source to read; default runtimeTargetKind, else project.
runtimeTargetKindRuntimeTargetKindNoUsed as the source to read when sourceTargetKind is omitted.
targetBranchIdIDNoRequired with the kind preview_branch.
targetEnvironmentIdIDNoNot supported for source reads; a non-null value is refused as invalid_input.

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

graphql
query TaskSource($projectReference: String!, $taskId: String!, $input: SourceReadSelectorInput) {
  taskSource(projectReference: $projectReference, taskId: $taskId, input: $input) {
    id
    name
    description
    editMode
    schedulable
  }
}
json
{
  "projectReference": "00000000-0000-4000-8000-000000000001",
  "taskId": "00000000-0000-4000-8000-000000000001"
}