Join 34,000+ subscribers and receive articles from our
blog about software quality, testing, QA and security.

Getting TestRail notifications to Slack


#41

Hi Jose,

We currently don’t have an estimate/expected release date and we would like to offer a more generic feature (e.g. web hooks) at some point which would also support Slack and other integrations.

Cheers,
Tobias


#42

Would also love to have webhooks and Slack integration from TestRail!


#43

Thanks for your feedback, James!

Cheers,
Tobias


#44

I have written code that does exactly this feature in Ruby,

The code is in an infancy state because I ripped it from a much larger bot that I am building. In order to run this ruby script I suggest you take it an adapt it to a fully fledged bot. However you can run it as is and it will work provided you make the necessary changes in the file to hook into your companies email server and so on. Then point test rail to where the script is and everything should work as is.

Install instructions for linux host:

  1. Install Ruby 2.3.1 as a service user on the TestRail server (or another server but update the start address to 0.0.0.0)
  2. Make a directory called testrail_interceptor
  3. Install bundler
  4. type the command bundle init
  5. put the file from the url in that directory
  6. add the following gems to the Gemfile
gem 'midi-smtp-server'
gem 'mail'
gem 'slack-ruby-client'
gem 'faye-websocket'

Now run bundle install and follow that by running ruby ./bot.rb. Make sure you made the necessary configuration options in the file. Read the comments in the file to get a grip of where to change what. Finally apologies for the not so great code as I said before these are just the bits and bobs needed to run ripped from a much larger bot I am building and I do recommend just extracting the code and adapting it to your own bot.


#45

Hi Michael,

Thanks for sharing this :slight_smile: I assume this handles notifications via emails and then forwards the message to Slack, is this correct?

Cheers,
Tobias


#46

Hey @tgurock,

Yes when it receives an email it extracts the subject line out, extracts who its supposed to go to, and extracts the url. Then once it has that information it queries slack for the user with the same email, sends them a private message with the subject line followed by the URL to the assignment, then takes the email and forwards it onto the original email server. (provided that whom ever is setting the script up supplies all the necessary information.) This way it gives you the best of both worlds you get the original email and a slack notification.

No tampering is done to the email as it is kept intact and stored in a variable with no transformations applied.


#47

Hi Michael,

That’s great, thanks!

Cheers,
Tobias


#48

Can’t wait for this integration -+1 for me as well!


#49

Thanks for your feedback, Ozz!

Cheers,
Tobias


#50

+1 for slack integration


#51

Hi Vasily,

Thanks for your feedback! I’ve added your vote to the request as well.

Regards,
Marco


#52

Slack 4ever,
+1 for this feature


#53

Hey Volodia,
I have added your vote.


#54

+1 for this feature.


#55

Hello,

Thanks for your feedback, vote added!

Regards,
Marco


#56

Upvoted


#57

Thanks Faisal, vote added!

Regards,
Marco


#58

Hi,

+1 for slack integration


#59

Thanks for your feedback, Evgeniia!

Cheers,
Tobias


#61

+1 for Slack Integration, please!