Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Release 6.2.0

...

Action

Category

Description

Required parameters

Optional parameters

Output formats

1

addAgentAssignment

Agent Assignments

Assign a project, plan, or job to a specific agent. This makes the agent is dedicated to only perform builds for all assignments. Use continue to ignore already exists error.

agent, assignment

continue

 

2

addAgent

Agents

Add a local agent.

agent

description

 

3

addArtifactDependency

Artifacts

Add an artifact dependency to a job. Artifact must be a shared artifact from another job.

plan, job, artifact, location

 

 

4

addArtifact

Artifacts

Add an artifact definition to a job. Server instances only.

plan, job, artifact, copyPattern

location, shared

 

5

addComment

Comments

Add a comment to a build.

build, comment

number, findReplace, findReplaceRegex, file, encoding

 

6

addJob

Jobs

Add a job to a stage.

plan, stage, job

name, description, disable

 

7

addLabels

Labels

Add a comma separated list of labels to a build.

build, labels

number

 

8

addNotification

Notifications

Add a plan notification. There are 2 parts to a notification - an event that triggers the notification and a recipient type that determines the notification protocol. There are built-in notifications and others provided by add-ons. A recipient type may have additional parameters. Generally, these can be specified by the field and values parameters. In some cases, pre-defined parameters are available.

plan, event, recipientType

fields, field1, value1, field2, value2, field3, value3, field4, value4, field5, value5, field6, value6, field7, value7, field8, value8

 

9

addRepository

Repositories

Add a global or plan repository. For a plan repository, you can reference a linked (global) repository. Otherwise a valid repository key or alias is required. Valid aliases are: BITBUCKET, BITBUCKET_CLOUD, BITBUCKET_SERVER, STASH, BCVS, GIT, GITHUB, MERCURIAL, PERFORCE, SUBVERSION

repository or name

plan, repositoryKey, replace, fields, field1, value1, field2, value2, field3, value3, field4, value4, field5, value5, field6, value6, field7, value7, field8, value8

 

10

addRequirement

Requirements

Add requirement to a plan job.

plan, job, requirement

type, value

 

11

addStage

Stages

Add a stage to a plan.

plan, stage

description, manual

 

12

addTask

Tasks

Add a task to a plan job. A valid task key or alias is required. Valid aliases are: ANT, ARTIFACT_DOWNLOAD, CHECKOUT, CLI_BAMBOO, CLI_BITBUCKET, CLI_CONFLUENCE, CLI_CRUCIBLE, CLI_FISHEYE, CLI_HIPCHAT, CLI_JIRA, CLI_SERVICE_DESK, CLI_UPM, GANT, GINT, GRADLE, GRADLEW, GROOVY, MAVEN2, MAVEN3, SCP, SQL, SCRIPT, SSH, VARIABLE_REPLACE

plan, job, taskKey

disable, final, fields, field1, value1, field2, value2, field3, value3, field4, value4, field5, value5, field6, value6, field7, value7, field8, value8

 

13

addTrigger

Triggers

Add a trigger to a plan. Pre-defined types are: polling, remote, scheduled. One or more repositories can be specified for pre-defined type triggers based on repositories. Custom types can be specified with the appropriate trigger key (or alias) and all required parameters using the various field parameters. Alias types are: stashTrigger.

plan, name, type

repository, schedule, ipRestriction, fields, field1, value1, field2, value2, field3, value3, field4, value4, field5, value5, field6, value6, field7, value7, field8, value8

 

14

addVariables

Variables

Add global or plan variables. Defaults to global variables unless a plan is specified. Use the field parameters for the variable name and the corresponding value parameters for the variable values,

 

plan, replace fields, field1, value1, field2, value2, field3, value3, field4, value4, field5, value5, field6, value6, field7, value7, field8, value8

 

15

clonePlan

Plans

Clone a plan.

plan, toPlan, name

description, projectName, disable

 

16

cloneProject

Projects

Clone each plan in a project to another project. If toProject is not provided, the plans will be cloned to the same project. If the toProject does not exist, it will be created with name provided by projectName.

project, toProject, projectName, disable

 

 

17

createOrUpdatePlan

Plans

Same as createPlan when plan does not exist. However, it will update an existing plan's name and description. Server instances only.

plan

name, projectName, description, disable

 

18

createPlan

Plans

Create a new plan. Provide a 2-part plan key where the first part is the project key. If the project key does not exist, it will be created with the provided project name. Server instances only. Use continue to ignore the request if the plan already exists.

plan

name, projectName, description, disable, continue

 

19

deletePlan

Plans

Delete a plan.

plan

 

 

20

deleteProject

Projects

Delete project and all project plans.

project

file

 

21

disableAgent

Agents

Disable an agent.

agent

 

 

22

disableJob

Jobs

Disable a job from running.

plan, job

 

 

23

disablePlan

Plans

Disable a plan from running.

plan

 

 

24

disableProject

Projects

Disable all project plans.

project

 

 

25

enableAgent

Agents

Enable an agent.

agent

 

 

26

enableJob

Jobs

Enable a job to run.

plan, job

 

 

27

enablePlan

Plans

Enable a plan to run.

plan

 

 

28

enableProject

Projects

Enable all project plans.

project

 

 

29

getAgentList

Agents

Get a list of agents based on regex filtering of agent names..

 

regex, file, append, encoding, columns

1 - basic
2 - detail

30

getArtifactDefinitionList

Artifacts

Experimental - only those available to be artifact dependencies in the last job! Get a list of shared artifact definitions for a plan with regex filtering on artifact name.

plan

limit, regex, columns, file, append, encoding

 

31

getArtifactList

Artifacts

Get a list of build result artifacts. When the build does not include a job portion, only shared artifacts are provided. Use @all for the job parameter to get both sharted and non-shared artifacts for all plan jobs.

plan or build

job, number, limit, regex, file, append, encoding

 

32

getArtifact

Artifacts

Download a copy of a build artifact into a file.

Uses same parameters and logic as getArtifactList for identifying build result artifacts to search. For artifacts that represent a directory (not a file), use the artifact name plus the path to the file in the artifact.

plan or build, artifact, file

job
number
replace
encoding

33

getBranchList

Branches

Get a list of branches for a plan with regex filtering on branch name or short name.

plan

limit, regex, columns, file, append, encoding

 

34

getBuildList

Builds

Get a list of build reults. Build results can be filtered by using fields and values. Supported fields are state, notState, and started. For example, include only successful results by using: --field1 state --value SUCCESSFUL, or include only builds started after a specific date use: --field2 started --value2 2016-04-30 --dateFormat yyyy-MM-dd. Default limit is 25.

plan

limit, favorite, labels, issues, columns, file, append, encoding, fields, field1, value1, field2, value2, field3, value3, field4, value4, field5, value5, field6, value6, field7, value7, field8, value8

1 - basic
2 - test information

35

getBuildQueueList

Builds

Get a list of builds waiting in the build queue. Subset by project or build.

 

project, build, file, append, encoding, columns

 

36

getBuild

Builds

Get build result.

build

number, expand, file

 

37

getClientInfo

Info

Get information about the this client tool.

 

outputFormat, file, append, encoding

1 - basic
2 - JVM

38

getCommentList

Comments

Get a list of comments for a build.

build

number, file, append, encoding, columns

 

39

getJobList

Jobs

Get a list of jobs for a plan with regex filtering on job key or name. Subset by stage if desired.

plan

stage, regex, file, attribute, columns

 

40

getLabelList

Labels

Get a list of labels for a build.

build

number, file, append, encoding, columns

 

41

getLatestBuildNumber

Builds

Get the number of the last completed build for this plan.

plan

 

 

42

getNotificationList

Notifications

EAP (subject to change). Get a list of plan notifications.

 

plan, file, append, encoding

 

43

getPlanList

Plans

Get a list of plans for a project with regex filtering on plan key or name. Use @all for project to get a list of plans across all projects.

project

favorite, excludeDisabled, excludeEnabled, limit, regex, outputFormat, dateFormat, columns, file, append, encoding

1 - plan
999 - last build results

44

getPlan

Plans

Get plan information.

plan

 

 

45

getProjectList

Projects

Get a list of projects. Projects are selected based on regex filtering on project key or name.

 

regex, file, append, encoding, columns

 

46

getRepositoryList

Repositories

Get a list of global or plan repositories with regex filtering on repository name.

 

plan, regex, file, append, encoding

 

47

getRepository

Repositories

Get details of a global or plan repository. Sets the repository and repositoryId replacement variables.

repository

plan

 

48

getServerInfo

Info

Get information about the Bamboo server.

 

outputFormat, dateFormat, file, append, encoding

1 - basic
2 - detail
3 - state

49

getStageList

Stages

Get a list of stages for a plan with regex filtering on stage name.

plan

regex, file, attribute, columns

 

50

getTaskList

Tasks

Get a list of tasks for a job with regex filtering on task name.

plan, job

limit, regex, file, columns

 

51

getVariableList

Variables

Get a list of global or plan variables based on regex filtering of variable names.

 

plan, regex, file, append, encoding

 

52

moveTask

Tasks

Move a task to before or after another task. Use final to make a task final. Final tasks must follow all non final tasks. If neither before or after are specified, the task will be moved to the last position respecting the final parameter.

plan, job, id

after or before, final

 

53

orderRepository

Repositories

Order repository in the list of repositories for a plan. Defaults to move the repository to the top to make it the default repository. Otherwise specify the after respository name.

plan, repository

after

 

54

queueBuildFromList

Builds

Queue multiple builds to run and wait for results. The action will not complete until all queued builds complete or times out. If continue is specified, builds will continue to be queued even after an attempt to queue a build fails. The action will fail if any build fails or times out. Conditional queueing is supported - see the documentation for details.

project or list

regex, limit, continue, timeout, dateFormat, fields, field1, value1, field2, value2, field3, value3, field4, value4, field5, value5, field6, value6, field7, value7, field8, value8

 

55

queueBuild

Builds

Queue a build to run. If wait is specified, the action will not complete until the queued build completes or the timeout period elapses. The action will fail if the build fails unless continue parameter is used to ignore a failed result. A specific revision can be built if the revision parameter is specified. Plan variables can be set using the field and value parameters. Conditional queueing is supported - see the documentation for details.

plan

branch, revision, wait, continue, timeout, dateFormat, fields, field1, value1, field2, value2, field3, value3, field4, value4, field5, value5, field6, value6, field7, value7, field8, value8

 

56

removeAgentAssignment

Agent Assignments

Remove an assignment from a specific agent. Use continue to ignore not found error.

agent, assignment

continue

 

57

removeAgent

Agents

Remove an agent.

agent

 

 

58

removeArtifact

Artifacts

Remove an artifact definition from a job. Server instances only.

plan, job, artifact

 

 

59

removeLabels

Labels

Remove labels from a build. Labels can be a comma separated list or regex. Either build or search terms (searchLabels, issues) must be provided

labels

build, number, searchLabels, issues, favorite

 

60

removeNotification

Notifications

Remove a plan notification. Use id of -1 to remove all notifications for a plan.

plan, id

 

 

61

removeRepository

Repositories

Remove global or plan repository. Use @all to remove all repositories.

repository or id

plan, continue

 

62

removeRequirement

Requirements

Remove a plan requirement.

plan, job, id

 

 

63

removeStage

Stages

Remove a stage from a plan. Use id = -1 to remove all stages. Use continue to ignore not found errors.

plan, stage or id

continue

 

64

removeTask

Tasks

Remove a task from a plan job. Use id = -1 to remove all tasks.

plan, job, id

 

 

65

removeTrigger

Triggers

Remove a trigger from a plan. Use id = -1 to remove all triggers. Server instances only.

plan, id

 

 

66

removeVariables

Variables

Remove global or plan variables. Specify the variable names using the field parameters.

 

plan, fields, field1, value1, field2, value2, field3, value3, field4, value4, field5, value5, field6, value6, field7, value7, field8, value8

 

67

renderRequest

Render

Render url based request. The response data modified by findReplace processing is returned.

request

requestParameters, requestType, type, acceptType, build, file, encoding, findReplace, findReplaceRegex

 

68

restartBuild

Builds

Restart a build that failed or was stopped. Use continue to ignore errors finding a build to restart or failed results.

plan

wait, timeout, continue

 

69

runFromAgentList

Agents

Run actions for each agent with regex filtering on agent name. Available replacement variables are agent and agentId.

 

regex, common, continue, simulate, clearFileBeforeAppend, file, encoding, findReplace, findReplaceRegex

 

70

runFromCsv

CSV

Run actions generated from a CSV file.

file

common, propertyFile, continue, quiet, simulate, clearFileBeforeAppend, encoding, findReplace, findReplaceRegex

 

71

runFromJobList

Jobs

Run actions for each job with regex filtering on job key or name. Restrict to a specific stage or leave stage blank to get jobs across all stages. Available replacement variables are project, projectName, plan, planName, stageId, stageName, job, and jobName.

plan

stage, regex, common, continue, simulate, clearFileBeforeAppend, file, encoding, findReplace, findReplaceRegex

 

72

runFromList

Run

Run actions for each entry in a list. When file is provided, each action in the file augmented by the common parameter will be run for each entry. Otherwise, just the action specified by the common parameter will be run. Available replacement variables are entry, entry2.

list

list2, file, common, continue, quiet, simulate, clearFileBeforeAppend, encoding, findReplace, findReplaceRegex

 

73

runFromPlanList

Plans

Run actions for each plan with regex filtering on plan key or name. Use @all for project to get a list of plans across all projects. Available replacement variables are project, projectName, plan, and planName.

project

favorite, excludeDisabled, excludeEnabled, regex, common, continue, simulate, clearFileBeforeAppend, file, encoding, findReplace, findReplaceRegex

 

74

runFromProjectList

Projects

Run actions for each project with regex filtering on project key or name. Available replacement variables are project and projectName.

 

regex, common, continue, simulate, clearFileBeforeAppend, file, encoding, findReplace, findReplaceRegex

 

75

runFromRepositoryList

Repositories

Run actions for each repository with regex filtering on repository name. Available replacement variables are repository and repositoryId.

 

plan, regex, common, continue, simulate, clearFileBeforeAppend, file, encoding, findReplace, findReplaceRegex

 

76

runFromSql

Run

Run actions generated by SQL provided by the sql parameter, a file, or standard input

sql or file or standard input

common, driver, database, host, port, url, dbUser, dbPassword, propertyFile, continue, simulate, clearFileBeforeAppend, encoding, findReplace, findReplaceRegex

 

77

runFromStageList

Stages

Run actions for each stage with regex filtering on stage name. Available replacement variables are project, projectName, plan, planName, stageId, and stageName.

plan

stage, regex, common, continue, simulate, clearFileBeforeAppend, file, encoding, findReplace, findReplaceRegex

 

78

run

Run

Run actions from a file or standard input.

file or standard input

common, continue, simulate, clearFileBeforeAppend, encoding, findReplace, findReplaceRegex

 

79

setDependencyOptions

 

Set child dependencies and other related options.

plan

children, fields, field1, value1, field2, value2, field3, value3, field4, value4, field5, value5, field6, value6, field7, value7, field8, value8

 

80

setFavoritePlan

Plans

Set the plan as a favorite.

plan

 

 

81

setJobOptions

Jobs

Set miscellaneous option for a job. The following options are specifically supported: clean working directory after job completes (cleanAfter switch) and pattern matching labeling (regex and labels parameters). Use the field and value parameters for additional settings with values determined from the screen. Some previous settings may be lost if not specifically requested.

plan, job

cleanAfter, regex, labels

 

82

stopBuild

Builds

Request to stop a queued or running build. Use continue to ignore errors finding a build to stop or failed results. The wait parameter will cause processing to wait for completion or timeout before returning.

plan

wait, timeout, continue

 

83

unsetFavoritePlan

Plans

Remove the plan from the favorite list.

plan

 

 

84

updatePlan

Plans

Update a plans name or description. Provide a 2-part plan key where the first part is the project key.

plan

name, description

 

85

updateRepository

Repositories

Update a global or plan repository.

repository or id

plan, fields, field1, value1, field2, value2, field3, value3, field4, value4, field5, value5, field6, value6, field7, value7, field8, value8

 

86

updateRequirement

Requirements

Update a plan requirement.

plan, job, id

type, value

 

87

updateTask

Tasks

Update a task in a plan job. You must provide the same parameters as if you were creating the task.

plan, job, id

enable, disable, fields, field1, value1, field2, value2, field3, value3, field4, value4, field5, value5, field6, value6, field7, value7, field8, value8

 

88

updateVariables

Variables

Update existing global or plan variables. Defaults to global variables unless a plan is specified. Use the field parameters for the variable name and the corresponding value parameters for the variable values,

 

plan, fields, field1, value1, field2, value2, field3, value3, field4, value4, field5, value5, field6, value6, field7, value7, field8, value8

 

89

validateLicense

Misc

Validates the CLI Connector is enabled and licensed on the server.

 

 

 

90

verifyBuild

Builds

Verify build was successful.

build

number

 

Parameter Tips

Common parameters

A few common parameters are available that are not specifically listed for each action: verbose, debug, quiet.

Tips

  • Use single dash for single letter parameters - example: -v
  • Use double dash for multi-letter parameters - example: --help
  • When parameters are specified, most need a value - example: --action addPage
  • Some parameters are flags (boolean) and must not be followed by a value - example: --verbose
  • Parameter names are case sensitive, but, action values are not - example: --userid is invalid but --action addpage is equivalent to --action addPage
  • Some parameters become required once a specific action is chosen. This is indicated in the help text for each action.
  • Some parameters have both short (one letter) and long (more than one letter) parameter names - example: -a or --action are the same
  • Some parameters have default values, if so, they are indicated in the help text - example: (default: automation)
  • Some parameters are required - indicated by (...) in the help text - example: (-a|--action) <action>
  • Some parameters are optional - indicated by [...] in the help text - example: [(-f|--file) <file>]
  • Values that have more than one word must be enclosed by double quotes - example: --title "this is my title"
  • Quoting rules in commands can vary by environment (sad), here are the techniques that may work in your environment:
    • Many environments: embedded double quotes within a double quoted string can be escaped by doubling the double quote - example: –common "-a addComment --comment ""This is an example of a double quoted string inside a double quote"" "
    • Some environments may need different escaping: embedded double quotes within a double quoted string can be escaped with a \ - example: –common "-a addComment --comment \"This is an example of a double quoted string inside a double quote\" "
    • Run CLI Actions usage: embedded double quotes within a double quoted string can be escaped by doubling the double quote (first example above)
    • A single quote sometimes can used in place of a double quote - example: –common '-a addComment --comment "This is an example of a double quoted string inside a double quote" '
  • Some parameters allow entry of a comma separated list of values, values containing a comma must be enclosed in single quotes - example: --custom "'first:a,b,c', second:x". Embedded single quotes within a quoted string must be doubled
  • Some text fields support the automatic conversion of " \n " (blanks are significant) to be replaced with a new line character - example: --description "A multi-line text field: \n # line 1 \n # line 2"
  • To get help for a specific action (release 5.5 and above), type the action followed by --help - example: --action getProjectList --help

Special parameter

Some special characters are difficult to deal with or make action text very complicated. This is because they have special meaning in either the OS command line handling, the tool's command line parsing, or the tool's use of separators (like comma or colon separated lists). As a convenience to avoid some of these nasty situations, a special parameter was implemented to allow alternate characters to be used instead of (or in addition to) the problematic characters within parameter values. The choice of what special characters to use depends on the content so that you do not have conflicts with intended content. The special parameter works by the user providing a order specific alternate character. The alternative character is replaced with the real character after all other parsing occurs. It is implemented for many action parameters that are problematic in this area. Not all situations are covered, but, that will improve as other use cases are identified.

PositionCharacterCharacter nameSuggested alternateUsage
1,comma Some parameters use comma separated lists.
2:colon#Some parameters use colon separated values.
3@at sign  
4'single quote Used in separated lists to cover cases where content contains separator.
5"double quote~Parameters containing blanks.

A blank in any position is ignored (no alternate provided).

Example: –special " #  ~" provides alternates for colon and double quote. 
         --common "--findReplace ~something to find containing a : (colon)#replacement~"  

Character Set

User and password values should be in the ISO-8859-1 character set. Non standard characters will result in an authorization error similar to: User is not authorized to perform the request.

 

...