It's all about the answers!

Ask a question

Not able to save some characters in description field of a work item

Arshad Adavani (231218) | asked Oct 27 '16, 8:29 a.m.
Hello All,

I am creating a work item through RTC java API. I have a string in description as "--> <--".
Value is properly set but when I save the work item it will be truncated to "-->".

No problem with the size of description fields. Same thing works fine if I add it to a comment.
Any hints/suggestions ?

One answer

permanent link
Kevin Ramer (4.5k6173191) | answered Oct 27 '16, 9:51 a.m.
I have seen that these items seem to get sanitized and things that look like HTML tags can remove bits of the input.
e.g.   user enters some "code" like

if ( runtime <1 ) {

The data from < to the end of the line is likely to be elided.  Similary for things that have what could be interpreted as general markup.  E.g.   The appearance of <words> or <phrases> ...

Arshad Adavani commented Oct 27 '16, 9:53 a.m.

Hi Kevin,
Thanks for your reply. Your analysis looks correct. Even I thought the same. But is there a way to get rid of this problem?

Kevin Ramer commented Oct 27 '16, 10:08 a.m.

I only noticed this because I'm responsible for an automation which bridges external data into RTC work items.  A recent change required that the automation could update a couple of attributes ( Description being one of them ).   I found it seems to be sufficient to encode the < and > to &lt;  and &gt; , respectively.

But I don't know how this might work in the interactive setting ( i.e. as a person writing the text )


Arshad Adavani commented Oct 27 '16, 10:33 a.m.

Hi Kevin,
I got a solution.. This was because of HTML as we analyzed. StringEscapeUtils class from Apache Commons helped me to resolve this issue.

Your answer

Register or to post your answer.