Post a Message to Slack

The Post a message to Slack post function allows you to send a personalized custom message to your Slack room. For example, you could be notified in a Slack channel when an issue is moved to Done.

Message templating

When configuring a message template for what you want to post to Slack, you can use plain text or use the GString TemplateEngine.

The issue variable is available for you to use in your template. For example, you can call a property as follows:

"Your issue $issue has been updated."

You can also do more complex calls to your object by using the <% %> notation:

"The issue $issue, which is assigned to <% out << issue.assignee %>, was updated."

Use this post function

Make sure you have set up a Slack connection before you use this post function. 

  1. Go to Administration > Issues > Workflows.
  2. Select Edit on the workflow you want to add the post function to. 
  3. Select the transition you want to add the post function to. 
  4. Under Options, select Post Functions.

  5. On the Transition page, select Add post function.
  6. Select Post a message to Slack.
    Image selecting this post function
  7. Select Add.
  8. Optional: Enter a note that describes the post function (this note is for your reference when viewing all post functions).
  9. Enter your bearer token to retrieve a list of target rooms (channels) you can post to. See Slack connection for more details.
  10. Select the target room (channel) you want to post to.
  11. Optional: Enter a condition. If no condition is specified, then this post function will always run.
  12. Enter a message to send. See Message templating above for guidance on creating your message template.
  13. Select Add.
  14. If applicable, reorder your new post functions using the arrow icons on the right of the function (they can only move one line at a time). Check out our documentation on Post function order for more information.
  15. Select Publish and choose if you want to save a backup copy of the workflow.

    Image with Publish option highlighted

    You can now test to see if this post function works.



Related content

On this page