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.
slackSend
: Send Slack Messagetoken
and channel
.
slackSend "Build Started - ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)"
attachments
(optional)
Object
baseUrl
(optional)
String
blocks
(optional)
Object
botUser
(optional)
Bot user option indicates the token belongs to a custom Slack app bot user in Slack.
If the notification will be sent to a user via direct message, the default integration sends it via @slackbot, use this option if you want to send messages via a bot user.
boolean
channel
(optional)
slackSend channel: "#channel-name", message: "Build Started: ${env.JOB_NAME} ${env.BUILD_NUMBER}"
String
color
(optional)
slackSend color: "#439FE0", message: "Build Started: ${env.JOB_NAME} ${env.BUILD_NUMBER}"
String
failOnError
(optional)
slackSend failOnError: true, message: "Build Started: ${env.JOB_NAME} ${env.BUILD_NUMBER}"
boolean
iconEmoji
(optional)
Choose a custom emoji to use as the bot's icon in Slack, requires using a bot user
String
message
(optional)
slackSend "started ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)"
String
notifyCommitters
(optional)
Notify committers via direct message in addition to specified channels, requires using a bot user
boolean
replyBroadcast
(optional)
boolean
sendAsText
(optional)
boolean
teamDomain
(optional)
String
timestamp
(optional)
String
token
(optional)
String
tokenCredentialId
(optional)
The ID for the integration token from the Credentials plugin to be used to send notifications to Slack. The "Kind" of the credential must be "Secret text." If both "Integration Token" and "Integration Token Credential ID" are set, the "Integration Token Credential ID" will take precedence for security reasons.
This overrides the global setting.
String
username
(optional)
Choose a custom username to use as the bot's name, requires using a bot user
String
slackUploadFile
: Upload file to slackfilePath
slackUploadFile "file.txt"
String
channel
(optional)
slackUploadFile channel: "#channel-name", filePath: "file.txt"
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 tokenString
initialComment
(optional)
slackUploadFile initialComment: "Test result failures", filePath: "file.txt"
String
slackUserIdFromEmail
: Resolve Slack UserId from Email Addressemail
A Slack User ID will be resolved from the email address using the users.lookupByEmail API method. Requires using a bot user.
String
botUser
(optional)
Bot user option indicates the token belongs to a custom Slack app bot user in Slack.
If the notification will be sent to a user via direct message, the default integration sends it via @slackbot, use this option if you want to send messages via a bot user.
boolean
tokenCredentialId
(optional)
The ID for the integration 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.
String
slackUserIdsFromCommitters
: Resolve Slack UserIds from Changeset AuthorsbotUser
(optional)
Bot user option indicates the token belongs to a custom Slack app bot user in Slack.
If the notification will be sent to a user via direct message, the default integration sends it via @slackbot, use this option if you want to send messages via a bot user.
boolean
tokenCredentialId
(optional)
The ID for the integration 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.
String
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.