CLI Macro

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 Appfire 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.
wrapMacronoformatWrap output with a macroMacro used to wrap the output of the action.
wrapMacroParameternoneMacro parameters added to the wrap macroMacro parameter string (wiki format) added to the macro used to wrap the output.
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}

Log a request with our support team.

Confluence®, Jira®, Atlassian Bamboo®, Bitbucket®, Fisheye®, and Atlassian Crucible® are registered trademarks of Atlassian®
Copyright © 2005 - 2024 Appfire | All rights reserved. Appfire™, the 'Apps for makers™' slogan and Bob Swift Atlassian Apps™ are all trademarks of Appfire Technologies, LLC.