Skip to content
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

NewLines in Message and Attachment Test not working #2

Open
eFloh opened this issue Nov 3, 2017 · 5 comments
Open

NewLines in Message and Attachment Test not working #2

eFloh opened this issue Nov 3, 2017 · 5 comments

Comments

@eFloh
Copy link

eFloh commented Nov 3, 2017

Hi,
great extension, thanks!
But to use it in conjunction e.g. with the GenerateReleaseNotes task it would be great to be able to use variables that contain newlines correctly.
When a variable contains a Newline-Character, currently `n will be slacked. (i.e. the backtick from powershell special character escaping is not properly replaced. `t for tab character is the same.
Maybe it would be enough to manually replace at least these two instead of creating a generic solution.

I think the replacement should be done after the JSON.Stringify calls.

Additionally, when entering SomeText\nWith a newline in the input boxes, the \n will also be masked and be part of the slack message instead of creating a newline.

Greetings, Florian

@kasunkv
Copy link
Owner

kasunkv commented Nov 3, 2017

@eFloh Thanks for using Slack Notification task and for giving this feedback. I will make the necessary changes and release an update to the task. I will keep you updated here.. :)

@gugavaro
Copy link

@eFloh did you find any work around for that?

@gugavaro
Copy link

gugavaro commented Sep 19, 2018

My suggestion is:

Message and PreText are very much the same type of field.

  • Keep the Message field the way it is without any modifications.
  • Change the PreText field to require a name of variable as input, so we can format the variable before hand and the variable is only expanded internally by the task not by VSTS.

this would be a one line change on the task

I believe on the task input.ts file, method toJSON

change this line
preText: this._preText,

to this line:
preText: process.env[this._preText],

or whatever is the way to read a variable.

@kamil2079
Copy link

Hey guys, thanks for your hard work.

I want to just tell you and others that for me, when using Powershel script only this works as a Newline-Character ``n
and I'm not even using variables as input capability because it doesn't work for me (ver.5)

@thisjustin816
Copy link

Has there been any movement on this issue? I'm currently trying to send a multiline message and can't figure out how to get the \n strings to not literally render in the message. I'm using powershell in a separate task to construct the message (and insert the \n characters) and the store in a pipeline variable which is used for input in the slack notification task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants