Context-relative shortcuts to property paths

9 minute readAutomation

A shortcut can be used to reference a property without knowing the exact name of the object that contains the property. You might think of a shortcut as another part of the property hierarchy. Shortcuts resolve to the correct property path even though its path elements may have changed because a project or procedure was renamed. Shortcuts are particularly useful if you do not know your exact location in the property hierarchical tree.

A shortcut can be used to reference a property without knowing the exact name of the object that contains the property. You might think of a shortcut as another part of the property hierarchy. Shortcuts resolve to the correct property path even though its path elements may have changed because a project or procedure was renamed. Shortcuts are particularly useful if you do not know your exact location in the property hierarchical tree.

Available shortcut contexts

The table below lists all shortcuts and the context in which they are available. Click on a shortcut name for more information about it.

Shortcut Name Available Context

job, step, or job step

pipeline, task, stage, or gate

Context Independent

myApplication

N/A

N/A

myApplicationTier

N/A

N/A

myArtifactVersion

N/A

N/A

artifactVersionNameTemplate field for the artifact

myCluster

N/A

N/A

myComponent

N/A

N/A

myCredential

N/A

myEvent

N/A

N/A

myEnvironment

N/A

N/A

myEnvironmentTier

N/A

N/A

myGate

N/A

myGateRuntime

N/A

myGroupTaskRuntime[/myGroupTaskRuntime]

N/A

myJob

N/A

N/A

myJobStep

N/A

N/A

myMicroserviceRuntime

N/A

N/A

myParent

N/A

N/A

myPipeline

myPipelineRuntime

N/A

myPipelineStageRuntime

myProcedure

N/A

N/A

myProcess

N/A

N/A

myProcessStep

N/A

N/A

myProject

N/A

myResource

N/A

N/A

myResourcePool

N/A

N/A

myRetrievedArtifact

N/A

N/A

myService

N/A

N/A

myStage

N/A

myStageRuntime

N/A

myStep

N/A

N/A

myState

N/A

N/A

mySubjob

N/A

N/A

mySubworkflow

N/A

N/A

myTask

N/A

myTaskRuntime

N/A

myTransition

N/A

N/A

myTriggeringPipelineRuntime

N/A

myUser

N/A

N/A

myWorkflow

N/A

N/A

myWorkflowDefinition

N/A

N/A

myWorkspace

N/A

N/A

Shortcut reference

Shortcuts to property paths that provide convenient run-time access include:

Property Description

/myApplication/…​

Start in the property sheet for the application associated with the current job or job step.

/myApplicationTier/…​

Start in the property sheet for the applicationTier associated with the current job step.

/myArtifactVersion/…​

Start in the property sheet for the artifactVersion associated with the current context. The only context where this property has any value is in the artifactVersionNameTemplate field for the artifact.

/myCluster/…​

Start in the property sheet for the cluster in the jobStep associated with the current microservice process.

/myComponent/…​

Start in the property sheet for the component associated with the current context.

/myCredential/…​

Start in the property sheet for the credential associated with the current job step. This form produces an error if the current job step does not have a credential.

/myDeployerRuntime/…​

Start in the property sheet for the deployer runtime to retrieve information for the current deployer runtime instance.

Examples:

/myDeployerTaskRuntime/outcome —Retrieve the outcome of the deployer task in the current context.

/myDeployerTaskRuntime/tasks/<subapplication>/job/jobId —Access the specified deployer subapplication.

/myDeployerRuntime/currentRunNumber -Get current run number.

/myEvent/…​

This is a special property used only within an email notifier. /myEvent/ allows you to refer to fields associated with the notifier itself. You can include these properties, for example, in the text of the email you send out for notification:

/myEvent/notifier: This property contains the name of the notifier that created the notifier event. You created this name when you created the notifier.

/myEvent/entity: This property contains the object where the notifier is attached. Two possible values are "job" or "jobStep," depending on where the notifier is attached.

/myEvent/source: This property contains the name of either the job or the jobStep where the notifier is attached.

/myEvent/type: This property defines whether the notifier is an "On Start" or an "On Completion" notifier. Two possible values are "STARTED" or "COMPLETED".

/myEvent/time: This property contains the time when the notifier occurred. The time is always specified in GMT and uses a formatted string, for example, 2009-06-11T21:00:56.502Z

/myEvent/timeMillis: This property contains the "timestamp" in milliseconds when the notifier occurred. This value is the number of milliseconds since January 1, 1970 GMT. The timeMillis corresponding to the time in the previous example is: 1244754056502

/myEnvironment/…​

Start in the property sheet for the environment associated with the current job or job step.

/myEnvironmentTier/…​

Start in the property sheet for the environmentTier associated with the current job step.

/myGate/…​

/myGate/ is currently limited to myGate.gateType ( PRE or POST ) or myGate.parentStage. It is useful to include information about the active gate and stage in email notifications templates.

/myGateRuntime/…​

Start in the property sheet for the gate runtime to retrieve information for the current gate runtime instance.

Examples:

/myGateRuntime/tasks/<taskName>/propertyName —Gate task accesses property on another task in an entry gate.

/myGateRuntime/currentRunNumber -Get current run number.

/myGateRuntime/runNumbers/1/subFlowRuntime/prop1 —Access property under the 1th gate run, previously set with /myGateRuntime/prop1.

/myGroupTaskRuntime

Examples:

/myGroupTaskRuntime/tasks/<taskName>/propertyName —Access the subtask runtime within the current group task context.

/myGroupTaskRuntime/currentRunNumber -Get current run number.

/myInventoryItem/…​

Starts in the property sheet for the environment inventory.

/myJob/…​

Start in the global property sheet for the current job. /myJob/ points directly to the job object so you can reference built-in job properties ( jobName, createTime, outcome, and so on) and custom properties. This property sheet can also be used to hold working data that needs to be passed from one step to another within the job.

/myJobStep/…​

Start in the property sheet for the current job step.

/myMicroserviceRuntime/…​

Start in the property sheet for the ec_microservice_deployment_properties property sheet associated with the current job or job step. This can be used by a plugin, procedure, or process step executed from a microservice application to retrieve property information stored on the microservice runtime.

/myParent/…​

Start in the global property sheet for the parent job step or job if this is a top-level step. /myParent/ points directly to the job or job step object, so you can reference intrinsic or custom properties. For example, you can reference the parameters that were passed to this procedure.

In addition, you can reference a sibling step by calling /myParent/jobSteps/<sibling step name>. Or, you can create additional properties on /myParent/ to pass information from one step in the procedure to another: step1 calls setProperty /myParent/results 100 step2 can call getProperty /myParent/results/myParent/.

/myPipeline/…​

Start in the property sheet for the pipeline associated with the current job or job step. This can be used by a plugin, procedure, or process step executed from a stage task to retrieve property information defined in the pipeline.

/myPipelineRuntime/…​

Start in the property sheet for the pipelineRuntime associated with the current job or job step. This can be used by a plugin, procedure, or process step executed from a stage task to retrieve property information stored on the pipeline runtime.

Examples:

/myPipelineRuntime/stages/<stageName>/outcome—Retrieve the outcome of a previous stage within the context of the current stage.

/myPipelineRuntime/stages/<stageName>/tasks/<taskName>/outcome —Retrieve the outcome of a task within the context of the current stage.

/myPipelineRuntime/stages/<stageName>/gates/PRE/tasks/<taskName<propertyName> —A gate task accesses a property on another task’s entry gate within the current pipeline runtime context.

/myPipelineRuntime/stages/<stageName>/gates/POST/tasks/<taskName>/<propertyName> —A gate task accesses a property on another task’s exit gate within the current pipeline runtime context.

/myPipelineRuntime/stages/<stageName>/tasks/<taskName>/<propertyName> —A stage task acccesses a property on itself.

/myPipelineRuntime/stages/<stageName>/gates/PRE/tasks/<taskName>/<propertyName> —A stage task accesses a property on an entry gte

/myPipelineRuntime/stages/<stageName>/tasks/<taskName>/job/<propertyName> —A task accesses a property on a job created by a task.

/myPipelineRuntime/stages/<stageName>/tasks/<taskName>/workflow/<propertyName> —A task accesses a property on a workflow created by a task.

/myPipelineStageRuntime/…​

Start in the property sheet for the pipelineStageRuntime for a pipeline stage where the current job or job step was defined. This can be used by a procedure step executed from a stage task to retrieve information for the summary property of the stage runtime.

/myPlugin/…​

Starts in the property sheet for the plugin associated with the current job.

/myProcedure/…​

Start in the property sheet for the procedure in which the current job step was defined. If the current job step is executing as part of a nested procedure, /myProcedure/ refers to the innermost nested procedure.

/myProcess/…​

Start in the property sheet for the application or component process in which the current job or job step was defined.

/myProcessStep/…​

Start in the property sheet for the application or component process step in which the current job step was defined.

/myProject/…​

Start in the property sheet for the project in which the current job step was defined. If the job step has nested procedure invocations, this is the project associated with the innermost nested procedure, for example, the project associated with /myProcedure/.

/myResource/…​

Start in the property sheet for the resource assigned to the current job step.

/myResourcePool/…​

Start in the property sheet for the resource pool that provided the resource for the current job step. Returns null if the step did not specify a resource pool.

/myStage/…​

Start in the property sheet for the pipeline stage in which the current job or job step was defined.

/myStageRuntime/…​

Start in the property sheet for the stage runtime for the current stage runtime instance. This can be used to retrieve information for the summary property of the stage runtime.

Examples:

myStageRuntime/tasks/test/outcome —Test the runtime outcome of the previous task in the current stage.

/myStageRuntime/runnumbers/1/output1 —Get the runtime outcome for specific runs in the current stage.

/myStageRuntime/runNumbers/1/subFlowRuntime/prop1 —Access property under the 1th stage run, previously set with /myStageRuntime/prop1.

/myStageRuntime/currentrunNumber —Get the current run number.

/myStageRuntime/tasks/<taskName>/propertyName —Stage task accesses a property on another task in a stage.

/myStageRuntime/tasks/groupTask/tasks/<subTaskName>/job/<jobid> —Access an underlying group task from withing the current stage runtime context.

/myStep/…​

Start in the property sheet for the current step. "Step" refers to the (static) definition of a step, which is part of a procedure– this is different from a job step, which represents a step when it executes (dynamically) in a job. Use /myJobStep/ to access the job step.

/myState/…​

Start in the property sheet for the state object so you can reference built-in and custom state properties or find parameter values passed to that state. When accessed from a state, /myState/ refers to that state. When accessed from a transition, /myState refers to the transition’s owning state. When accessed from a job or job step, /myState/ refers to the state that launched that job as a subjob.

/mySubjob/…​

Start in the property sheet for the subjob so you can reference built-in and custom job properties, parameters passed to the job, and properties on steps within that job. When accessed from a transition, /mySubjob/ refers to the subjob started by the state that owns that transition. This property path is particularly useful in conditions for On Completion transitions because the outcome or other information for the subjob can influence which state the workflow transitions to next.

/mySubworkflow/…​

Start in the property sheet for the subworkflow so you can reference built-in and custom workflow properties. When accessed from a transition, /mySubworkflow/ refers to the subworkflow started by the state that owns that transition. This property path is particularly useful in conditions for On Completion transitions because the active state and other information for the subworkflow can influence which state the workflow transitions to next. You can access information about states and transitions belonging to the workflow by using the path /mySubworkflow/states/someState or /mySubworkflow/states/someState/transitions/someTransition.

/myTask/…​

Start in the property sheet for the pipeline task in which the current job or job step was defined.

/myTaskRuntime/…​

Start in the property sheet for the task runtime. This can be used to retrieve information for the summary property of the task runtime.

Examples:

/myTaskRuntime/runnumbers/2/output1 —Get the runtime outcome for specific runs in the current task.

/myTaskRuntime/runNumbers/1/subFlowRuntime/prop1 —Access property under the first task run, previously set with /myTaskRuntime/prop1.

/myTaskRuntime/propertyName —Task accesses property on itself.

/myTaskRuntime/job/propertyName —Task accesses property on a job created by a task.

/myTaskRuntime/workflow/propertyName —Task accesses property on a workflow created by a task.

/myTaskRuntime/currentRunNumber -Get current run number .

/myTransition/…​

Start in the property sheet for the transition object so you can reference intrinsic and custom transition properties. /myTransition/ is accessible only from a transition.

/myTriggeringPipelineRuntime/…​

In a situation where a pipeline triggers a sub-pipeline, this property accesses the runtime context of the parent pipeline from within the sub-pipeline runtime context.

/myUser/…​

This property can be used only if the current session is associated with: the predefined "admin" user, a user defined as "local", or a user defined by a Directory Provider (LDAP or ActiveDirectory). This property cannot be used if the user is a "project principal", which is normally the case when running inside a CloudBees CD/RO step.

For example, with an interactive login you can use: ectool getProperty /myUser/userName (to get the username of the logged in user, or…​) ectool getProperty /myUser/email (to get the email address)

/myWorkflow/…​

Start in the property sheet for the workflow object so you can reference built-in and custom workflow properties. When accessed from a state or transition, /myWorkflow/ refers to the "owning" workflow. When accessed from a job or job step, /myWorkflow/ refers to the workflow whose state launched that job as a subjob. You can access information about states and transitions belonging to the workflow by using the path /myWorkflow/states/someState or /myWorkflow/states/someState/transitions/someTransition.

/myWorkflowDefinition/…​

Starts in the property sheet for the workflow definition object so you can reference built-in and custom workflow properties.

/myWorkspace/…​

Start in the property sheet for the workspace associated with the current job step.