The following plugin provides functionality available through Pipeline-compatible steps. Read more about how to integrate steps into your Pipeline in the Steps section of the Pipeline Syntax page.

For a list of other such plugins, see the Pipeline Steps Reference page.

Slack Notification Plugin

slackSend: Send Slack Message

Simple step for sending a Slack message to specified channel.
Use the advanced settings to override the Slack Plugin global configuration to include: token and channel.
Please see the Slack Plugin global configuration for more details on the fields. Usage Example:
slackSend "Build Started - ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)"

slackUploadFile: Upload file to slack

  • filePath
    File path to search in to upload the file. Globs are accepted but only the first file found will be uploaded.
    slackUploadFile 'file.txt'
    • Type: String
  • channel (optional)
    Allows overriding the Slack Plugin channel specified in the global configuration. Multiple channels may be provided as a comma separated string.
    slackUploadFile channel: "#channel-name", filePath: "file.txt"
    • Type: String
  • credentialId (optional)

    The ID for the bot user token from the Credentials plugin to be used to send notifications to Slack. The "Kind" of the credential must be "Secret text."

    This overrides the global setting.

    The user token must be the bot user oauth token
    • Type: String
  • initialComment (optional)
    A comment that will be added by the bot when the file is uploaded slackUploadFile initialComment: "Test result failures", filePath: "file.txt"
    • Type: String

Was this page helpful?

Please submit your feedback about this page through this quick form.

Alternatively, if you don't wish to complete the quick form, you can simply indicate if you found this page helpful?

    


See existing feedback here.