slack-plugin: Cannot override global configuration 'Is Bot User?' with botUser parameter in slackSend step
Environment
-
Jenkins version -> latest LTS -> 2.164.2
-
Plugin version -> 2.23
-
OS - Centos Linux 7
Description
I’m having global configuration of jenkins slack plugin with legacy token and with selected check box Is Bot User? like on screen bellow
Because I have a lot of jobs configured as bot user, and I need to add new integration, and I cannot disable this in global configuration, so I tried to run in pipeline slackSend (using jenkins app token, not legacy) as following:
slackSend(message: "some message", botUser: false, teamDomain: "somemydomain", baseUrl: "https://somemydomain.slack.com/services/hooks/jenkins-ci/", tokenCredentialId: "slack-app-integration-token")
and message it’s sent properly but I’m seeing error in the job:
Slack Send Pipeline step running, values are - baseUrl: https://somemydomain.slack.com/services/hooks/jenkins-ci/, teamDomain: somemydomain, channel: , color: <empty>, botUser: true, tokenCredentialId: slack-app-integration-token
ERROR: Could not parse response from slack, potentially because of invalid configuration (botUser: true and baseUrl set), response: ok
So I think, when botUser parameter is used in slackSend step, then it should be used.
About this issue
- Original URL
- State: open
- Created 8 years ago
- Comments: 22 (10 by maintainers)
Refer to https://github.com/jenkinsci/slack-plugin/blob/63274b4e998e5c7771c1c424bc1ab4d9e076048c/src/main/java/jenkins/plugins/slack/SlackNotifier.java#L540
Once
this.botUserordescriptor.isBotUser()is true, the result must be true, so that we can’t use botUser in pipeline to replace the one inGlobal Slack Notifier Settings. Hope someone can enhance it.