Bitbucket replacement variables

Bitbucket replacement variables

The following variables are available when working with Bitbucket repositories:

Variable

Description

Since

Variable

Description

Since

project

Last created or referenced project key

 

projectId

Last created or referenced project ID (numeric)

 

projectUrl

Last created or referenced project URL

8.4

repository

Last created or referenced repository slug

 

repositoryId

Last created or referenced repository ID (numeric)

 

repositoryUrl

Last created or referenced repository URL

8.4

repositoryName

Last created or referenced repository name

8.4

pullRequest

Last created or referenced pull request name

 

pullRequestId

Last created or referenced pull request ID (numeric)

 

pullRequestUrl

Last created or referenced pull request URL

8.4

branch

Last created or referenced branch name

 

branchId

Last created or referenced branch ID (numeric)

 

restriction

Last referenced branch restriction type

 

restrictionId

Last created or referenced branch restriction ID

 

matchingType

Last referenced branch restriction matching type

 

matchingId

Last referenced branch restriction matching ID

 

commitId

Last referenced commit ID

 

commitAuthorId

Last referenced commit author ID

 

hook

Last referenced hook key

11.0

hookName

Last referenced hook name

11.0

hookConfiguration

Last referenced hook configuration (with outputFormat 2)

11.0

sshKeyId

Last created SSH key ID (numeric)

 

group

Last referenced group name

 

userId

Last referenced user ID

9.3

userKey

Last referenced user key (numeric ID)

9.3

userDisplayName

Last referenced user display name

9.3

applicationLink

Last referenced application link name

8.7

applicationLinkId

Last referenced application link ID

7.7

applicationLinkUrl

Last referenced application link URL

8.7

path

Last referenced path

9.8

pathId

Last referenced path ID

9.8

revision

Last referenced revision

9.8

type

Last referenced file type (FILE or DIRECTORY)

9.8

downloadUrl

Last referenced download URL

9.8


Bitbucket Cloud replacement variables

The following variables are available when working with Bitbucket Cloud repositories:

Variable

Description

Since

Variable

Description

Since

branch

Last created or referenced branch

10.0

commit

Last referenced commit ID

10.0

commitMessage

Last referenced commit message

10.0

deployment

Last referenced deployment key

10.0

deploymentName

Last referenced deployment name

10.0

deploymentUuid

Last referenced deployment UUID

10.0

pullRequest

Last referenced pull request ID

10.0

pullRequestName

Last referenced pull request name (title)

10.0

project

Last created or referenced project key

9.3

projectUuid

Last created or referenced project UUID

9.3

projectName

Last created or referenced project name

9.3

pipeline

Last started or referenced pipeline number

10.0

pipelineState

Last referenced pipeline state

10.0

pipelineResult

Last referenced pipeline result

10.0

pipelineUrl

Last referenced pipeline URL

10.3

pipelineUuid

Last referenced pipeline UUID

10.2

pipelineCache

Last referenced pipeline cache name

10.4

pipelineCacheUuid

Last referenced pipeline cache UUID

10.4

pipelineCacheUrl

Last referenced pipeline cache archive URL

10.4

stepName

Last referenced pipeline step name

10.4

stepUuid

Last referenced pipeline step UUID

10.4

stepState

Last referenced pipeline state

10.4

stepResult

Last referenced pipeline result

10.4

runner

Last referenced runner name

10.0

runnerUuid

Last referenced runner UUID

10.0

runnerType

Last referenced runner type

11.1

runnerLabels

Last referenced runner labels

10.0

runnerOauthClientId

Last referenced runner OAuth client ID

11.1

runnerOauthClientSecret

Last added runner OAuth client secret (addRunner action only)

11.1

repository

Last referenced repository key

10.0

repositoryFullKey

Last referenced repository full key

10.0

repositoryName

Last referenced repository name

10.0

repositoryUuid

Last referenced repository UUID

10.0

userId

Last referenced user name

10.0

userKey

Last referenced user key

10.0

userDisplayName

Last referenced user display name

10.0

userUuid

Last referenced user UUID

10.0

workspace

Last referenced workspace key

10.0

workspaceName

Last referenced workspace name

10.0

workspaceUuid

Last referenced workspace UUID

10.0


Common Client Variables

These variables are commonly available across various actions:

Variable

Description

Since

Variable

Description

Since

entry

Entry being processed from the list parameter of the runFromList action

 

entry2

Entry being processed from the list2 parameter of the runFromList action

 

renderRequest

Last result from the renderRequest action modified by findReplace processing

 

server

Server URL available for clients accessing a remote server

9.0

hosting

Available with getServerInfo for clients accessing a remote server with server, cloud, datacenter as values

9.3

version

Available with getServerInfo for clients accessing a remote server

9.3

runDate

For run action scripts, it is the client date at the time of the first action referencing the value. The replacement date will be exactly the same for all subsequent references for consistency across actions. Formatted according to current dateFormat parameter or default as usual for date fields.

9.0

file

File path name for last get or get list action that used the file parameter

9.3

fileSize

File size for the last get or get list action that used the file parameter

9.3

fileContent

File text content for the last get or get list action that used the file parameter (limited to a file with size < 10MB)

9.3


Additional Information

  • The syntax for using these variables is @<variable>@.

  • Variable names are case-sensitive.

  • Variables are set by specific actions, and their availability depends on the context in which they are used.

  • Within a run script, the getReplacementVariableList action will list currently defined variables, except for pre-defined variables (server, runDate).

  • The setReplacementVariableList action can be used to set custom variables within a run script.

  • Variables are available within the scope of the run action that contains the action that sets the variable or a parent run action. Sibling (runFromList scripts) variable sets are independent of each other.