Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Slack Notify pipe - Example of providing a simple text file as contents

Will Marsman October 25, 2022

https://bitbucket.org/atlassian/slack-notify/src/master/

 

Currently, we're using the slack notify pipe in order to add additional context. This pipe provides a way of providing a simple message, or a Block Kit style message.

However, what we typically want to do is provide a multi-line plain-text file as part of the message.

Unfortunately, this is somewhat of a tricky thing to do, as the naive approach with the `MESSAGE` parameter and `PAYLOAD_FILES` can be difficult.

Example 1: using the MESSAGE parameter

- pipe: atlassian/slack-notify:1.0.2
variables:
WEBHOOK_URL: $SLACK_WEBHOOK_URL
PRETEXT: 'Releasing!'
MESSAGE: >
$(cat output.txt)

I believe this does not work as output.txt ends up breaking interpretation of the yaml file.

Example 2: using the PAYLOAD_FILES parameter

Using this parameter requires massaging this multi-line file in order to get it to show up, and can be quite confusing without dropping into a full programming language.

My request

It would be nice if the documentation provided an example which demonstrates how to provide a simple multi-line text file as either a MESSAGE parameter or a the PAYLOAD_FILES, or add a new parameter to support the common case of wanting to provide a text file as a message in slack.

1 answer

0 votes
Igor Stoyanov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 28, 2022

@Will Marsman  hi. Thanks for your suggestion.

 

To cover your case check this reference of how to attach file. 

 

Regards, Igor

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events