createTask

Back to index

Summary

Creates a new task for a task container.
projectName
Stringrequired
The name for the project that must be unique among all projects.
taskName
Stringrequired
The name of the task.
actionLabelText
Stringoptional
The JSON derived action label text.
actualParameters
Mapoptional
Actual parameters passed to an invoked subprocedure.
advancedMode
Booleanoptional
True to enable advanced mode so as to templatize snapshotName.
afterLastRetry
Stringoptional
Specify continue or stop pipeline execution after last unsuccessful retry or a task.
Possible values: "continueOnError", "stopOnError"
afterTask
Stringoptional
If specified, the task will be placed after the named task.
allowOutOfOrderRun
Booleanoptional
If True, allow to run a task out of order.
allowSkip
Booleanoptional
When enabled, manual task or gate rule can be skipped.
alwaysRun
Booleanoptional
True means this task will run even if preceding tasks fail in a way that aborts the pipeline.
applicationName
Stringoptional
The name of the application used in sub task.
applicationProjectName
Stringoptional
Name for the project to which the application belongs to.
applicationVersion
Stringoptional
Application version to be deployed by a sub task.
approvers
Collectionoptional
A list of task approvers who receive the notification.
artifacts
Stringoptional
If specified, the task will be placed before the named task.
beforeTask
Stringoptional
If specified, the task will be placed before the named task.
ciConfigurationName
Stringoptional
The CI configuration name.
ciControllerFolder
Stringoptional
Path to the folder on the CI controller referenced by the CloudBees Operation Center that contains the specified CI controller. Must be in format folder1/folder2/folder3/... .
ciControllerName
Stringoptionaldeprecated
Name of the CI controller. Deprecated in favor of ciEndpoint argument.
ciEndpoint
Stringoptional
Endpoint value configured for CI controller.
ciJobBranchName
Stringoptional
Name of the CI Job Branch.
ciJobFolder
Stringoptional
Path to the folder on the CI server referenced by the CI configuration that contains the specified CI job. Must be in format folder1/folder2/folder3/... .
ciJobName
Stringoptional
Name of the CI job.
command
Stringoptional
Command or script to execute for the task.
condition
Stringoptional
A fixed text or text embedding property references that is evaluated into a logical TRUE or FALSE. An empty string, a 0 or false is interpreted as FALSE. Any other result string is interpreted as TRUE.
customLabel
Stringoptional
Custom display name for sub pipelines or releases.
deployerExpression
Stringoptional
A fixed text or text embedding property references that is evaluated into a logical TRUE or FALSE. An empty string, a 0 or false is interpreted as FALSE. Any other result string is interpreted as TRUE.
deployerRunType
Stringoptional
The type of the deployer run for deployer type of task. If parallel then all applications are deployed in parallel.
Possible values: "parallel", "serial"
description
Stringoptional
Comment text describing this object that is not interpreted at all by CloudBees CD/RO.
disableFailure
Booleanoptional
True means a manual task cannot be failed.
duration
Stringoptional
Duration in minutes for which the stage or task should relative to plannedStartDate.
emailConfigName
Stringoptional
The name of the email configuration.
enabled
Booleanoptional
True to enable the task.
environmentName
Stringoptional
Environment name to create from template.
environmentProjectName
Stringoptional
Name for the project to which the environment or environment template belongs to.
environmentTemplateName
Stringoptional
Environment template name.
environmentTemplateProjectName
Stringoptional
Name for the project to which the environment template belongs to.
errorHandling
Stringoptional
Specifies error handling for this task.
Possible values: "continueOnError", "retryOnError", "stopOnError"
externalApplicationId
Stringoptionalpreview
Unique application identifier maintained by an external system. Used to identify applications deployed by CloudBees CD/RO pipelines within CloudBees Compliance.
firstTask
Booleanoptional
True to make a task first in a stage.
gateCondition
Stringoptional
A fixed text or text embedding property references that is evaluated into a logical TRUE or FALSE. An empty string, a 0 or false is interpreted as FALSE. Any other result string is interpreted as TRUE.
gateType
Stringoptional
The type of the gate.
Possible values: "POST", "PRE"
groupName
Stringoptional
The name of the group of task.
groupRunType
Stringoptional
The type of the sub task run for a group task. If serial then all tasks are run in serial, otherwise - in parallel (by default).
Possible values: "parallel", "serial"
hookActualParameters
Mapoptional
The hook actual parameters passed to an invoked subprocedure.
hookCommand
Stringoptional
The command for the hook procedure to execute as the last step.
hookProcedureName
Stringoptional
The name of the hook procedure to execute as the last step.
hookProjectName
Stringoptional
Name of the project, corresponding to the hook procedure name, to execute as the last step.
hookShell
Stringoptional
The shell for the hook command to execute as the last step.
hookStageSummaryParameters
Stringoptional
JSON representation of hook stage summary parameters and labels.
insertRollingDeployManualStep
Booleanoptional
True to indicate a manual step to inject after each phase or batch.
instruction
Stringoptional
Instruction associated with the task.
keepOnError
Booleanoptional
True to keep environment on error (default is false).
notificationEnabled
Booleanoptional
True means this email notification is enabled, false otherwise.
notificationTemplate
Stringoptional
String containing email formatting instructions for generating notifications.
outOfOrderRunAssignees
Collectionoptional
A list of users who can run a task out of order.
parallelToPrevious
Booleanoptional
If TRUE, the flow state will be run in parallel to the previous flow state.
pipelineName
Stringoptional
The name of the pipeline.
plannedEndDate
Stringoptional
The date when this stage or task is expected to end.
plannedStartDate
Stringoptional
The date when this stage or task is expected to start.
postp
Stringoptional
This command runs in parallel with the main command for the task; it analyzes the log for the step and collects diagnostic information.
precondition
Stringoptional
A fixed text or text embedding property references that is evaluated into a logical TRUE or FALSE. An empty string, a 0 or false is interpreted as FALSE. Any other result string is interpreted as TRUE.
releaseManifest
Stringoptionalpreview
Components (artifacts or container images) that are being deployed in the release payload, specified in JSON format.
releaseName
Stringoptional
The name of the release.
requiredApprovalsCount
Stringoptional
The number of users from a group that should approve the task before it's considered as finally approved.
resourceName
Stringoptional
The name of the default resource for this task.
retryCount
Stringoptional
If the retry is auto, specify the maximum number of times retry should occur.
retryInterval
Stringoptional
If the retry is auto, specify the number of seconds to wait until the next retry should occur.
retryType
Stringoptional
Type of retry when process step or task fails. Is one of auto or manual.
Possible values: "auto", "manual"
rollingDeployEnabled
Booleanoptional
Perform rolling deployment.
rollingDeployManualStepAssignees
Collectionoptional
A list of assignees who receive the notification when rolling deploy iteration completes.
rollingDeployManualStepCondition
Stringoptional
Defines run condition on manual step created during rolling deployment.
Possible values: "always", "failure", "success"
rollingDeployPhases
Collectionoptional
One or more rolling deploy phases to be used for deployment.
rolloutApprovers
Collectionoptional
A list of rollout approvers.
rolloutNotificationEnabled
Booleanoptional
Rollout notification enabled (default is false).
shell
Stringoptional
The shell or command-line program to run the command block in.
skippable
Booleanoptional
True if a task is skippable.
snapshotName
Stringoptional
Name of the snapshot associated with the application.
stageName
Stringoptional
Name of the stage to which this task belongs to.
stageSummaryParameters
Stringoptional
JSON representation of stage summary parameters and labels.
stagesToRun
Collectionoptional
One or more stages to run in a pipeline.
startTime
Stringoptional
The time of day to begin invoking this task (24-hour clock, for example, 17:00).
startingStage
Stringoptional
The name of the starting stage.
subErrorHandling
Stringoptional
The impact of invoking pipeline run when sub-pipeline fails.
Possible values: "continueOnError", "stopOnError"
subTaskType
Stringoptional
The type of the sub task.
Possible values: "DEPLOY", "NONE", "UNDEPLOY"
subapplication
Stringoptional
The name of the application that owns the subprocess.
subpipeline
Stringoptional
If referencing a pipeline, the name of the pipeline.
subpluginKey
Stringoptional
If referencing a procedure, the name of the procedure's pluginKey.
subprocedure
Stringoptional
If referencing a procedure, the name of the procedure.
subprocess
Stringoptional
The name of the process.
subproject
Stringoptional
If referencing a procedure, the name of the procedure's project.
subrelease
Stringoptional
If referencing a release, the name of the release.
subreleasePipeline
Stringoptional
The name of the pipeline to be used when attaching to the release instantiate from a release task.
subreleasePipelineProject
Stringoptional
The name of the project which contains the pipeline to the release instantiate from a release task.
subreleaseSuffix
Stringoptional
The suffix to be used when creating release.
subworkflowDefinition
Stringoptional
If referencing a workflow definition, the name of the workflow definition.
subworkflowStartingState
Stringoptional
The name of the starting state in the specified workflow definition.
taskProcessType
Stringoptional
The type of the process a task can invoke.
Possible values: "APPLICATION", "OTHER", "SERVICE"
taskType
Stringoptionalpreview
The type of task.
Possible values: "APPROVAL", "CI_JOB", "COMMAND", "COMPLIANCE_CHECK", "CONDITIONAL", "DEPLOYER", "GROUP", "MANUAL", "PIPELINE", "PLUGIN", "PROCEDURE", "PROCESS", "RELEASE", "UTILITY", "WORKFLOW"
tierResourceCounts
Mapoptional
Resource count per resource template tier.
timeZone
Stringoptional
The time zone to use when interpreting times.
triggerType
Stringoptional
The type of trigger when invoking a sub-pipeline.
Possible values: "async", "sync"
useApproverAcl
Booleanoptional
True if after approve the authentication context of approving user should be added to the session.
waitForPlannedStartDate
Booleanoptional
True to enable waiting for planned start date.
workspaceName
Stringoptional
The name of the workspace.

Usage

Perl

$cmdr->createTask( "test-projectName", # projectName "test-taskName" # taskName # optionals );

ectool

ectool createTask \ "test-projectName" `# projectName` \ "test-taskName" `# taskName` \ # optionals

Examples

Perl

To run the Save results task before the Save log file task:

$cmdr->createTask("Default", "Save results", {beforeTask => "Save log file"});

To create a task as the first task in a stage:

$cmdr->createTask("Default", "Enter user name and password", {firstTask => true});

To create a task with Run if and Wait until conditions:

$cmdr->createTask("Default", "Deploy WAR file", {condition => $[/javascript (myTask.taskName == myTask.deployWar), precondition => $[/myTask/autoTestCompleted]]});

To create a task and assign user-defined labels to the actions:

$cmdr->createTask( "proj", "task4", {stageName => 'Stage 1', pipelineName => pipe1, actionLabelText => '{"completed":"Approve","failed":"Reject","skipped":"Skip"}', --taskType => MANUAL});

To create a gate rule and assign user-defined labels to the actions:

$cmdr->createTask( "proj", "rule3", {stageName => 'Stage 1', pipelineName => pipe1, gateType => PRE actionLabelText => '{"completed":"Approve","failed":"Reject","skipped":"Skip"}', --taskType => APPROVAL});

ectool

To run the "Save results task before the Save log file task:

ectool createTask "Default" "Save results" --beforeTask "Save log file"

To create a task as the first task in a stage:

ectool createTask "Default" "Enter user name and password" --firstTask true

To create a task with Run if and Wait until conditions:

ectool createTask "Default" "Deploy WAR file" --condition "$[/javascript (myTask.taskName == myTask.deployWar)" --precondition "$[/myTask/autoTestCompleted]"

To create a task and assign user-defined labels to the actions:

ectool createTask proj task4 --stageName 'Stage 1' --pipelineName pipe1 --actionLabelText '{"completed":"Approve","failed":"Reject","skipped":"Skip"}' --taskType MANUAL

To create a gate rule and assign user-defined labels to the actions:

ectool createTask proj rule3 --stageName 'Stage 1' --pipelineName pipe1 --gateType PRE --actionLabelText '{"completed":"Approve","failed":"Reject","skipped":"Skip"}' --taskType APPROVAL