Open mightywomble opened 3 years ago
I don't think that's a bug. It sounds like you are missing something. If you are using a pipeline this works. Of course use your own webhook.
discordSend description: "Lua check for the win", footer: "This should be green, yellow means issues with the code, and red is just bad.", link: env.BUILD_URL, result: currentBuild.currentResult, title: JOB_NAME, webhookURL: 'https://discord.com/api/webhooks/YOURWEBHOOKHERE
I get the same issue as soon as I tick "Enable URL Linking"
Notifications are sent as expected when this is unchecked.
nz.co.jammehcow.jenkinsdiscord.exception.WebhookException: {"embeds": ["0"]}
at nz.co.jammehcow.jenkinsdiscord.DiscordWebhook.send(DiscordWebhook.java:212)
at nz.co.jammehcow.jenkinsdiscord.WebhookPublisher.perform(WebhookPublisher.java:293)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:803)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:752)
at hudson.model.Build$BuildExecution.cleanUp(Build.java:187)
at hudson.model.Run.execute(Run.java:1953)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
I have set the URL in the global Jenkins settings.
Having the same problem. Did find a fix?
I was having the same problem, the solution for me was set the Jenkins URL
via UI:
Manage Jenkins > System > Jenkins Location > Jenkins URL
via JCasC (Helm instalation):
set .controller.jenkinsUrl
in values file
Version report
Jenkins and plugins versions report:
Reproduction steps
Within a declarative pipeline (webhook URL edited below) I've added this
Even if i use something far similar
discordSend description: '', footer: '', image: '', link: 'env.BUILD_URL', result: '', thumbnail: '', title: 'MoveFiles', webhookURL: 'https://discord.com/api/webhooks/842304094/yeoAn6A_9XY2O71dFbhlt9lUZrAW6OnFEG7y'
Results
Expected result:
Message in discord
Actual result:
nz.co.jammehcow.jenkinsdiscord.exception.WebhookException: {"embeds": ["0"]} at nz.co.jammehcow.jenkinsdiscord.DiscordWebhook.send(DiscordWebhook.java:212) at nz.co.jammehcow.jenkinsdiscord.DiscordPipelineStep$DiscordPipelineStepExecution.run(DiscordPipelineStep.java:171) at nz.co.jammehcow.jenkinsdiscord.DiscordPipelineStep$DiscordPipelineStepExecution.run(DiscordPipelineStep.java:132) at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47) at hudson.security.ACL.impersonate2(ACL.java:449) at hudson.security.ACL.impersonate(ACL.java:461) at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829)