-
Notifications
You must be signed in to change notification settings - Fork 413
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom message doesn't respect \n #135
Comments
From slack @bredman posted the following advice.
The Slack plugin uses a different JSON library in Jenkins but it's likely the same issue. Contributions are welcome to potentially fix this issue. I don't actively develop this plugin but maintain pull requests and releases. |
After testing, the text box for custom messages is a multi-line text box. Therefore, this behavior is already supported. You need only press ENTER to get a new line without using the |
I used an environment variable, ${SLACK_MESSAGE}, as the custom message, like this:
SLACK_MESSAGE=Line1\nLine2\nLine3
The message itself had \n for new lines, but in Slack they got printed as literal "\n".
The environment variable was being loaded by EnvInject Plugin from a file.
I managed to fix it by having escaped new lines in the java properties file like this:
The text was updated successfully, but these errors were encountered: