Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sendAsText is only used for test connections #781

Open
mjainta opened this issue Dec 30, 2021 · 0 comments
Open

sendAsText is only used for test connections #781

mjainta opened this issue Dec 30, 2021 · 0 comments
Labels

Comments

@mjainta
Copy link

mjainta commented Dec 30, 2021

Jenkins and plugins versions report

Jenkins: 2.319.1
OS: Linux - 5.4.0-1055-aws

...
slack:2.49
...

Please call me if you need more information, as I don't want to paste all plugin information of our system in here.

What Operating System are you using (both controller, and any agents involved in the problem)?

any

Reproduction steps

  1. Set up a logger as described in https://plugins.jenkins.io/slack/#plugin-content-enable-additional-logging
  2. Go to "Manage Jenkins" -> "Configure system" and enable "Send as text" in the "Slack Notifier" configuration (It's in the advanced section)
    • Also configure a running connection to Slack
  3. Create a job with the Slack Notifier enabled via Post-Build script
  4. Run the job

Expected Results

The "Slack Notifier" plugin should send JSON with a "text" key.

Actual Results

Go to the created Logger. There should be the JSON with the "attachment" syntax, instead of using "text"

Anything else?

I don't know if this bug also exists in Jenkins pipelines, but looking at the code (I am very bad at Java) I see it is only used in tests and in SlackNotifier::doTestConnection() so it only is used for the test connection right now.
I think this should also work for regular calls and think it's intended that way.

The "attachment" JSON payload unfortunately is not supported by Slack workflow (https://slack.com/help/articles/360035692513-Guide-to-Workflow-Builder) which we want to use.
I tried to go around that by using "sendAsText" but unfortunately only the "test connection" works, real calls from Jenkins jobs fail.

@mjainta mjainta added the bug label Dec 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant