Start Jenkins job from slack command

Slack is one of popular communication open source tool. Many team use it for work.

If your project has  Jenkins server and development team want build/run test via Slack command, this post maybe helpful.

The first you need install jenkins plugin: Build Token Root Plugin

screen-shot-2017-02-21-at-18-02-51

Then Enabled Trigger builds remotely in your Jenkins job like screenshot below:

screen-shot-2017-02-21-at-18-05-49

 So from now you can “Use the following URL to trigger build remotely: JENKINS_URL/job/JmeterSample/build?token=TOKEN_NAME or /buildWithParameters?token=TOKEN_NAME
Optionally append &cause=Cause+Text to provide text that will be included in the recorded build cause.” 

 

In slack, Go to Slack integration page set like screenshot below

screen-shot-2017-02-21-at-18-11-41

 

 

-> Now you can use command /sample in slack to start this jenkins job

4 thoughts on “Start Jenkins job from slack command

  1. A says:

    This is exactly how i configured the slash command.
    But I keep getting the “Darn – that slash command didn’t work (error message: `503_service_error`). Manage the command at text.”

    If i trigger the URL with curl, the build gets triggered though.

    Am i missing something?

    Like

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.