It's all about the answers!

Ask a question

What do I use for "newline" character when adding a multiline comment to a WI via curl?


Donald Poulin (2249119107) | asked Dec 02 '13, 2:39 p.m.
edited Dec 02 '13, 4:23 p.m. by Krzysztof Kaźmierczyk (7.4k375103)
Using REXX I created a multi line stem variable and concatenated a "0A" to the end of each line and then wrote the stem structure to a file (omvs). I then used iconv to convert the file I created to UTF-8 and then added the new comment via a curl command. I see the comment ok within the work item but it is all one line. I have tried using "0D"x instead of "0A"x but I am still seeing a single line that "wraps" within the comment/discussion section of the work item. What is the secret to getting a multi-line comment to show up as multiple lines within a work item?

Comments
Kevin Ramer commented Dec 02 '13, 3:41 p.m.

This will be a WAG, but maybe try <br/> ?


Donald Poulin commented Dec 04 '13, 8:37 a.m.

Tried and still same issue. I am running REXX under zOS omvs and want to add a multiline comment to  a work item and have the individual lines show up as separate lines in the work item  comment. I can successfully add the  comment to  the work item via curl and the oslc api but it shows as one continuous line

2 answers



permanent link
Mark Noonan (1313) | answered Dec 21 '15, 7:36 p.m.
edited Dec 21 '15, 7:39 p.m.
Hello,
I have been using XML input, with cURL to send it, to create a workitem and update the description field. I was using <br/> directly in the XML, but RTC was stripping that out, and giving one line of text in the field.

To get the linefeed or break to happen I use the & way to describe the lt and gt characters. I use this and it works for me (remove the spaces when you do it): & lt;br/& gt; 

Regards
Mark Noonan



permanent link
David Steimle (11) | answered May 17 '17, 7:51 a.m.

"0d0a"x gives me a newline if I concat it to another string. I have a little script that creates commented section headers for bash scripts:

SAY "Name your section:"
PARSE UPPER PULL title
comment =        "#------------------------------------------------#"
comment = comment"0d0a"x
comment = comment"#"CENTER(title,48)"#"
comment = comment"0d0a"x
comment = comment"#------------------------------------------------#"
SAY comment

Which writes:

------------------------------------------------

THIS IS A SAMPLE

------------------------------------------------

I believe you need both 0d and 0a much like you would use \r\n in an extended expression replace.


Comments
David Steimle commented May 17 '17, 7:52 a.m.

Wow, that formatted strangely...


Ralph Schoon commented May 17 '17, 10:51 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

In a world where everything uses the same characters for everything (XML, HTML, **ML) this is almost unavoidable.

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.