Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 10 Current »

Parameters

ParameterDefaultMacro Browser LabelDescription
profile Profile

Pre-configured profile defined by administrator used to provide some other parameters. This parameter may be restricted for security reasons. Administrators should see Get Started for more information.

product ProductOne of the Atlassian CLI supported products: confluence, jira, bamboo, stash, crucible, or fisheye. This parameter may be restricted for security reasons.
scriptmacro bodyScript location

Additional SQL statements can be added after the macro body sql by specifying another location:

  • #filename - Data is read from the file located in confluence home directory/script/filename. Subdirectories can be specified.
  • global page template name - Data is read from a global page template.
  • space:page template name - Data is read from a space template.
  • ^attachment - Data is read from an attachment to the current page.
  • page^attachment - Data is read from an attachment to the page name provided.
  • space:page^attachment - Data is read from an attachment to the page name provided in the space indicated.
data@DATA: in macro bodyData location

Specify the location if input data to be used by actions. Input data is provided to the script as standard input which is used directly by some actions (like run) or can be used for a few parameters like file to provide file like data. For instance, using: --file -. The dash for a CLI action indicates the file data is provided from standard input.

  • #filename - Data is read from the file located in confluence home directory/script/filename. Subdirectories can be specified.
  • global page template name - Data is read from a global page template.
  • space:page template name - Data is read from a space template.
  • ^attachment - Data is read from an attachment to the current page.
  • page^attachment - Data is read from an attachment to the page name provided.
  • space:page^attachment - Data is read from an attachment to the page name provided in the space indicated.
showCommandfalseShow command in panelShow the action command in a panel.
paneltrueUse panel for outputUse a no format panel to wrap the output. Output is shown by default unless hideOutput specifies otherwise.
hideOutputfalseHide the outputHide the output generated by the CLI command. Useful when the command produces file output that is accessed separately.
macrosfalseRender macrosRender macros in the body before processing.
server CLI serverCLI server equivalent to specifying the --server parameter on the CLI.
user CLI userCLI user equivalent to specifying --user parameter on the CLI.
password CLI passwordCLI password equivalent to specifying --password on the CLI.
directory DirectoryDirectory used for server file access (read and write). Defaults to Confluence home directory/script. This parameter is restricted for security reasons.
subDirectory Sub directorySub directory relative to the directory used for server file access.
dataSource Data sourceSpecify application server provided SQL datasource for use in runFromSql actions. Directly provided database parameters can not be used. This parameter may be restricted for security reasons. 

Example - Simple 

{cli:profile=confluence}
--action getSpaceList
{cli}

Example - Run Multiple Actions

{cli:profile=confluence}
--action run 
 
@DATA:
--action storePage --space Examples --title "My Example Page" --parent @home --content "{children}"
--action storePage --space Examples --title "My Example Detail Page" --parent "My Example Page" --content "..." 
{cli}

Example - Using SQL

{run:titleRun=Add labels|replace=space:zcli,labels:test}
{cli:profile=confluence|datasource=confluenceDS}
--action runFromSql --continue
 
@DATA:
select '--action addLabels --labels "$labels" --space $space --title "' || title || '"' from content where spaceid in (select spaceid from spaces where spacekey = '$space')
{cli}
{run}
  • No labels