Slack Notification with YAML

YAML parameters for Slack Notification

You can find the list with common parameters for all Buddy actions here.

NameTypeDescription
action
Required
StringThe ID of the action.
type
Required
StringThe type of the action. Should be set to SLACK.
channel
Required
StringThe ID of the Slack channel. More info here.
integration_id
Required
IntegerThe ID of the integration.
content
Required
StringThe content of the notification.
attachmentsString[]The array of the Slack message attachments. More info here.
trigger_conditionStringDefines when the build action should be run. Can be one of ALWAYS, ON_CHANGE, ON_CHANGE_AT_PATH, VAR_IS, VAR_IS_NOT or VAR_CONTAINS.
trigger_condition_pathsString[]Required when trigger_condition is set to ON_CHANGE_AT_PATH.
trigger_variable_keyStringRequired when trigger_condition is set to VAR_IS, VAR_IS_NOT or VAR_CONTAINS. Defines the name of the desired variable.
trigger_variable_valueStringRequired when trigger_condition is set to VAR_IS, VAR_IS_NOT or VAR_CONTAINS. Defines the value of the desired variable which will be compared with its current value.
disabledBooleanWhen set to true the action is disabled. By default it is set to false.
variablesVariable[]The list of variables defined for this action.
file_attachmentsString[]The attached files.

YAML example for Slack Notification

actions:
- action: "Send notification to deploys channel"
type: "SLACK"
content: "[#${execution.id}] ${execution.pipeline.name} execution by <${invoker.html_url}|${invoker.name}>"
channel: "C0GAADCCL"
attachments:
- "{\"fallback\":\"${execution.pipeline.name} execution #${execution.id}\",\"color\":\"good\",\"fields\":[{\"title\":\"Successful execution\",\"value\":\"<${execution.html_url}|Execution #${execution.id} ${execution.comment}>\",\"short\":true},{\"title\":\"Pipeline\",\"value\":\"<${execution.pipeline.html_url}|${execution.pipeline.name}>\",\"short\":true},{\"title\":\"Branch\",\"value\":\"${execution.branch.name}\",\"short\":true},{\"title\":\"Project\",\"value\":\"<${project.html_url}|${project.name}>\",\"short\":true}]}"
integration_id: 1
variables:
- key: "ftp_login"
value: "userLogin123"
description: "The name of user to FTP."
- key: "ftp_password"
value: "secure!14ivLMxPgv7TX6c9+ITX/g=="
encrypted: true
description: "The password for ftp."
file_attachments:
- "fs:///file1"
- "fs:///file2"