Answers: <p>As far as I was able to tell it's not possible.</p>
  
  <p>We solved this by using Pipeline putting the custom messages in the Jenkinsfile.</p>
  
  <p>The flexibility gained by having the Jenkinsfile in the git repo really helped our developers have a better understanding of the build process, and allowed them to make necessary changes to the build commands without the communications headache.</p>
  
  <p>It's a nice excuse to move over to Pipeline.</p>
  
  <p>It also happens to be very easy to do:</p>
  
  <p><code>slackSend (color: colorCode, message: customMessage)</code></p>
  
Answers: CC BY-SA 3.0
Answers: 2017-04-07T14:48:32.247Z
Answers: yeah, we're slowly moving over to pipelines so that'll solve it long term, just wondered if there was a shortterm solution. Thanks!
Answers: Alex
Answers: CC BY-SA 3.0
Answers: 2017-04-06T16:19:11.300Z
Answers: 2017-04-06T16:19:11.300Z
Answers: avi
Body: <p>We're running Jenkins with the <a href="https://wiki.jenkins-ci.org/display/JENKINS/Slack+Plugin" rel="noreferrer">Slack Notification Plugin</a>. Is there a way to send the custom message only on completion, not on start? To be clear, I <strong>don't</strong> want to disable the build started message, I'd just like the custom text to only show on completion (success). </p>
  
  <p>Use case is jobs like delete stack. We use the custom message to make it clear which stack the job deleted, but you end up with slack messages like (paraphrased)</p>
  
  <pre><code>Delete job started
    Deleted Alex stack
  
  Delete job finished
    Deleted Alex stack
  </code></pre>
  
  <p>Obviously you can see where this causes confusion. I'd rather get</p>
  
  <pre><code>Delete job started
  
  Delete job finished
    Deleted Alex stack
  </code></pre>
  
  <p>"It can't be done" is an acceptable answer if that's the case. I know I can do a pipelines workaround but I'd love a quick fix for the jobs we haven't converted yet.</p>
  
Comments: CC BY-SA 3.0
Comments: 2017-04-06T14:45:15.237Z
Comments: Best bet I could say is: fork the plugin and tweak [this line](https://github.com/jenkinsci/slack-plugin/blob/master/src/main/java/jenkins/plugins/slack/ActiveNotifier.java#L85) to remove the custom message on start. I assume opening an issue as feature request could be an idea also, I didn't saw a way to disble the custom message on specific steps only.
Comments: Tensibai
Tags: <jenkins><slack>
Title: How to include a custom Slack message only on completion?
UserDisplayName: Alex
ThreadText: # How to include a custom Slack message only on completion?
  
  (Asked by: username_0 on 2017-04-06)
  
  We're running Jenkins with the [Slack Notification Plugin](https://wiki.jenkins-ci.org/display/JENKINS/Slack+Plugin). Is there a way to send the custom message only on completion, not on start? To be clear, I **don't** want to disable the build started message, I'd just like the custom text to only show on completion (success).
  
  Use case is jobs like delete stack. We use the custom message to make it clear which stack the job deleted, but you end up with slack messages like (paraphrased)
  
  ```
  Delete job started
    Deleted username_0 stack
  
  Delete job finished
    Deleted username_0 stack
  
  ```
  
  Obviously you can see where this causes confusion. I'd rather get
  
  ```
  Delete job started
  
  Delete job finished
    Deleted username_0 stack
  
  ```
  
  "It can't be done" is an acceptable answer if that's the case. I know I can do a pipelines workaround but I'd love a quick fix for the jobs we haven't converted yet.
  
  **Tags:** jenkins, slack
  
  > **Comments:**
  > **username_1**: Best bet I could say is: fork the plugin and tweak [this line](https://github.com/jenkinsci/slack-plugin/blob/master/src/main/java/jenkins/plugins/slack/ActiveNotifier.java#L85) to remove the custom message on start. I assume opening an issue as feature request could be an idea also, I didn't saw a way to disble the custom message on specific steps only.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2017-04-06. Score: 7 | Accepted answer
  
  As far as I was able to tell it's not possible.
  
  We solved this by using Pipeline putting the custom messages in the Jenkinsfile.
  
  The flexibility gained by having the Jenkinsfile in the git repo really helped our developers have a better understanding of the build process, and allowed them to make necessary changes to the build commands without the communications headache.
  
  It's a nice excuse to move over to Pipeline.
  
  It also happens to be very easy to do:
  
  `slackSend (color: colorCode, message: customMessage)`
  
  > **Comments:**
  > **username_0**: yeah, we're slowly moving over to pipelines so that'll solve it long term, just wondered if there was a shortterm solution. Thanks!  
  
  ---
  
  