It's all about the answers!

Ask a question

RTC: bold text in script based default values

Simon Eickel (1.1k75457) | asked Jan 12 '16, 4:03 a.m.
edited Jan 12 '16, 6:03 a.m. by Ralph Schoon (63.3k33646)
Hi there,

long time no see but I found the way back ;)

I have on question regarding default Values in RTC.
We would like to do a similar thing as it is configured on
When raising a defect a pre-filled description should appear.

If I use a simple default value (Multi-Line HTML Provider) I am able to use bold and italic text frames to structure my text. This is really helpful but the problem is that If i change the description attribute of type defect to use this default value - all work item types are using this default value ... this seems to be based on the fact that this information is stored within the attribute itself (which is the same in all WI types).

So the only way seems to be using a javascript (as it is done at, too).
Using a script snipped I am not able to use bold and italic text frames ...
The HTML code will be only written "as is" within the description field.

So - my question:
How can I use bold and italic text when using script-based default values?

My current snipped looks this:

The behaviour within the browser when creating a new defect is:


One answer

permanent link
Ralph Schoon (63.3k33646) | answered Jan 12 '16, 6:03 a.m.
My finding so far is, that the script returns a string, which the internal API converts using XMLString.createFromPlainText(string) which escapes all control characters.

I have not found a way in a script to use something similar to XMLString.createFromXMLText() and return the XMLString to preserve the control characters.

I believe it is impossible to generate proper HTML/XML fro HTML attributes (including description and summary) with JavaScript. The only way to achieve creating formatting and links was by using the work item attribute type WIKI.

I would assume that a Java based value provider can use said methods, but I am not sure.

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.