I would like to send slack messages for "Failed Builds And First Successful" to the Committers (the ones who are responsible for the new changes). Is it possible somehow to add Slack as IM for a user?
Or is it possible to accomplish this in any other way? Currently Bamboo is spamming our #bamboo slack channel as all notifications go there.
Hi Tobias,
Yes, it is possible.
Follow the below steps:
1. In your Slack go to Permissions tab and enable XMPP gateway (SSL only).
2. Go to your "Workspace settings" > Gateway Configuration.
Here you will get something like this:
Getting Started: XMPP
Host: <your-workspace-url>.xmpp.slack.com
User: <user-name>
Pass: <password>
You can generate a new password for XMPP
Your XMPP or Jabber ID is in the user@host format. Your ID is <user-name>@<your-workspace-url>.xmpp.slack.com.
Your password is that big long string — the whole thing.
Once you've authenticated, try joining your workspace’s #general channel with the following parameters:
general (no hash sign) for the room name
conference.<your-workspace-url>.xmpp.slack.com for the server (i.e. put "conference." at the beginning of your XMPP host name)
<user-name> as your handle
<password> as your password
Now, go to your Bamboo:
1. IM Server settings to configure it with below details:
Host <your-workspace-url>.xmpp.slack.com
Username <user-name>
Resource Bamboo
Requires an TLS/SSL connection true
Force legacy SSL false
2. Set your notification for the build plan with an Event as "Failed Builds And First Successful" and "Notification recipient" as "Committers (users who have committed to the build)"
Pointers here:
1. Make sure the user which is committing the change has the IM settings as "<user-name>@<your-workspace-url>.xmpp.slack.com"
For setting this up, edit your user and add the above as "IM"
2. The user who is committing the change should match with the user in the Bamboo user repository and matches the above point 1 here.
This way whenever this user commits any changes, the notification will be sent only to this user according to the notification event.
Hope this will help.
Thanks!
Hi @robhit, Thanks for your reply. I have set up everything as you specified, but I am not getting messages unfortunately.
1. IM Server Setup (works)
I have created a new user in Slack called: "bamboo" (otherwise everyone would get messages from me). The credentials I have added under BAMBOO ADMINISTRATION - IM Server. Adding my xmpp address (tobias.fielitz@redmarker.xmpp.slack.com) in the "Test recipient address" field successfully sends a message from the Slack bamboo user to me saying "Your instant messaging server settings are correctly set up." So that works, great! I have added my xmpp address (tobias.fielitz@redmarker.xmpp.slack.com) under BAMBOO ADMINISTRATION - User management - <edit my user> - IM.
2. Plan Notifications Setup (doesn't work)
All attempts to receive a notification on build were not successful so far. I have set up quite a few notifications for testing but none is delivered:
Event Notification recipient Actions
Comment Added Tobias Fielitz (user)
BoBot #bamboo (Slack channel)
All Builds Completed Responsible (users who are responsible for the current failure)
Committers (users who have committed to the build)
Change of Build Status Responsible (users who are responsible for the current failure)
Committers (users who have committed to the build)
Tobias Fielitz (user)
Failed Builds And First Successful Committers (users who have committed to the build)
BoBot #bamboo (Slack channel)
For example, when adding a comment for my build I am receiving a message in the #bamboo slack channel (as before), but I am not getting a personal message.
I am not even getting a notification if I add a notification directly send to my IM address (Add notification - Comment Added - Recipient: IM Address - tobias.fielitz@redmarker.xmpp.slack.com)
What am I missing?
Thanks again for your help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @[deleted],
Do your settings look like this:
Do you see any difference here?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @[deleted],
Sorry, I just realized that while configuring IM server you have to uncheck the "Requires an TLS/SSL connection". Then it will work.
I have just tested it:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @robhit, I have tried both options for "Requires an TLS/SSL connection" checked and unchecked. In both cases test notifications work and build notifications don't. There must be something else.
I can't see any difference to my configuration.
1. I have tested that the IM Server Setup works.
2. Even when setting my xmpp address directly under notifications it does not work.
Here is my user:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @[deleted]
What do you see in the logs?
Do you see something like this:
2017-11-24 12:07:44,781 INFO [XMPP Worker] [BambooSmackClient] Connecting to InstantMessagingServerDefinitionImpl{name='Default', host='robhit-interest.xmpp.slack.com', port=null, username='robhit_saxena', resource='Bamboo', secureConnectionRequired=true, enforceLegacySsl=false}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
When sending a test notification I can see it in the logs:
2017-11-24 17:25:40,308 INFO [http-nio-8085-exec-2] [AccessLogFilter] tobias.fielitz POST https://<host>/admin/instantmessagingserver/editInstantMessagingServer.action 59126kb
2017-11-24 17:25:40,313 INFO [http-nio-8085-exec-2] [BambooSmackClient] Connecting to InstantMessagingServerDefinitionImpl{name='Default', host='redmarker.xmpp.slack.com', port=null, username='tobias.fielitz696', resource='Bamboo', secureConnectionRequired=true, enforceLegacySsl=false}
When commenting on my build (which should trigger a notification) I can't see any notifications:
2017-11-24 17:26:31,201 INFO [http-nio-8085-exec-19] [AccessLogFilter] tobias.fielitz POST https://<host>/build/ajax/createComment.action 164606kb
2017-11-24 17:26:31,346 INFO [http-nio-8085-exec-19] [DefaultBuildResultsIndexer] Indexing DS-BLW-8
2017-11-24 17:26:31,370 INFO [23-IndexerService.indexer:pool-39-thread-1] [DefaultBuildResultsIndexer] Indexed DS-BLW-8
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.