Rational Team Concert - Calculated Value - Insert link in a html field
2 answers
Yes, HTML attributes are supported when using JavaScript. It is basically filled with a string. See https://jazz.net/wiki/bin/view/Main/AttributeCustomization and https://jazz.net/library/article/1093 (Lab 4 and 5) for some hints.
Comments
To figure the format for HTML links I would export existing data with a link and look at how it is represented. I have not tried that with HTML myself, as far as I remember. The format for a wiki type attribute can be found in Lab 5 of the workshop above.
Thanks Ralph.
The thing with what we waht to do is that with the script we are returning something like this:
<a href="http://www.google.com">Google</a>
And when we save the Work Item the field value instead of showing Google is showing <a href="http://www.google.com">Google</a> with the complete html.
My suggestion would be to use the lab 5 JavaScript 'spy' tool to look at what is available in a HTML field with a link and use that syntax for you own script. I can only provide an example for Wiki attribute types and did so in the Lab 5.
1 vote
I have looked into that again recently and here is the catch.
When using the JavaScript API, the provider returns a string. When returning a string, all XML characters are escaped. So it is essentially not possible to create a link in any HTML attribute, including the description.
In the Java API, it is possible to use an XMLString to create the content from XML, which can contain the HTML tags for a link and set that, but it is not possible from JavaScript.
When using the JavaScript API, the provider returns a string. When returning a string, all XML characters are escaped. So it is essentially not possible to create a link in any HTML attribute, including the description.
In the Java API, it is possible to use an XMLString to create the content from XML, which can contain the HTML tags for a link and set that, but it is not possible from JavaScript.