Jenkins Slack Integration to set reminders - jenkins

I am trying to set Slack reminders via a Jenkins job. We are using the Slack plugin (https://plugins.jenkins.io/slack) which seems to work great for direct messages, but I am unable to set reminders. Running the /remind command in Slack, obviously, works. But when I try to use the same command as a Custom Message, it doesn't. Following is what I have set currently, but it doesn't seem to work ie no reminders are getting set.

The Custom Message field in the Slack plugin is just for messages - it is not parsed by Slack for Slack slash commands that are ordinarily typed by a Slack user in Slack's message entry field.
The Slack plugin appears to label the contents of the Custom Message field as text and wrap other info around it in order to provide the green/amber/red indicator that is displayed to the left of the message, along with the build # and Success/Fail etc. notification.
See https://api.slack.com/docs/message-formatting

Related

How to send test execution report (report.html) from jenkins by using Slack notification add-on

I just installed the slack notification add-on in Jenkins and I can get notification if the build is success/failed as like below:
I wanna add few more things here since I'm very new to this implementation and looking help from experts.
I just wanna add test execution report (.htm) file and send it into this channel along with build number and job URL.
If the build is failed. I just want to capture the build failed message from console log and need to send that message to slack channel instead of saying the build failed.
Can someone help me to achieve this?
I just tried the notification but don't know how to attach the html report and add custom message for failed jobs. If there is any reference that will be very helpful.

how to disable autoscroll when bot replacing message in in slack interactive messsage?

When a slack user send my bot a message, my bot will reply with buttons. the button will utilize slack interactive message.
When user click on one of that buttons, the bot will replace the message with several texts and attachments.
my problem is that interactive message trigger scroll down to the end. how can I keep slack app not scrolling down when bot replying a message?
You can't.
You have very little control of how the Slack UI is rendering your message. And Slack will always render a new message at the bottom of a channel, which is why your updated message "scrolls down".
In general this is a feature, since Slack is made to be 100% platform agnostic and your apps will work just as well on e.g. browser, windows client or iPhone app.

How to send slack notification in Jenkins based on variable?

I want to send some alerts if something happened in the middle of the build.
I'm planning to save it to environment variable.
I want to trigger Slack Notification based on this environment variable.
It means that if the environment variable is there, I want to trigger Slack Notification.
Is it possible somehow?
Yes it is possible, either by using slack webhook api directly either using 3rd party tools like Jenkins Slack plugin.

Slack post by bot not always containing

I'm using the "incoming webhooks" feature of Slack to post notifications to a channel. I'm also using the "icon_emoji" feature to decorate the messages and to highlight the different types of messages. However I find that the image doesn't show up consistently:
Ie. only when it says BOT does the image also show up.
Any ideas what the issue is? Ideally I would like for the image to show up each message so that they can be scanned easily (some messages are more informative and others need to be acted upon in a timely manner).
Slack is automatically consolidating consecutive messages that are sent within a certain time frame. So the bot icon will show for the first message only and consecutive messages will display beneath the first without the bot icon.
This is standard behavior of Slack and works the same for user messages. Don't believe there is any way to turn that off.

How can I add my own button in slack chat box by slack API

I am trying to develop an APP and integrate it with Slack.
I have a confusion, can I add the app into chat box just like DropBox did? I searched the Slack API and found nothing about it.
enter image description here
No, as far as I know this feature is not available to Slack developers at the moment. Might be added at a later time though.
You could use a slash command instead to trigger your external application.

Resources