It's all about the answers!

Ask a question

Extended Rich Text through Server API

Uwe Berthold (6627) | asked Dec 11 '18, 3:44 a.m.
edited Dec 11 '18, 3:44 a.m.

I'm trying to set the description of newly created work items through the server API. The description should contain rich text, such as bold text.

I'm using the method IWorkItem.setDescription(...) to do so, and this is essentially my code:

IWorkItem wi = ... ;
String description = .... ;

I get the following error message:
"The work item with the ID xxx cannot be saved because this client version cannot modify extended rich text content in the attributes '[Description]'. To modify an attribute that contains extended rich text use the web client.

This means that the Web UI uses different API to handle rich text?!
How can I accomplish this with the server API?

I'm using RTC 6.0.6, Liberty server

Accepted answer

permanent link
Uwe Berthold (6627) | answered Dec 18 '18, 3:06 a.m.

 I've changed the markup to use bold text (b HTML tag) instead of underline (u HTML tag), and it worked.

Enabling or disabling extended rich text did not make a difference.

I think the error message emitted by RTC is not 100% accurate.

What confused me the most, though, is that I was using the server-side API (inside an IOperationParticipant), and I assumed that calls by the web client would go through the same API once it reaches the server, but apparently that is not the case.

Ralph Schoon selected this answer as the correct answer

Ralph Schoon commented Dec 18 '18, 3:10 a.m.

The Web UI uses REST interfaces to communicate with the server. This is not necessarily the same API. The fact that the operation participant is executed regardless if this is from the Web UI or not, does not really matter. It is the same API as a follow up action, but the API used to change values might not be the same API. My 2 cents. 

Ralph Schoon commented Dec 18 '18, 5:01 a.m.

BTW, thanks for sharing. It is appreciated if you answer your own questions, if you find a solution.  

One other answer

permanent link
Ralph Schoon (63.3k33646) | answered Dec 18 '18, 2:41 a.m.

 I think, I have not played with that using the  API, this is related to the new rich text content that can be enabled for RTC. It appears that the client API can not set this information. You will have to look how the Web UI does this. An alternative could be to use a normal text attribute for the automation and let the description to be used by users in the Web UI.

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.