How to dispaly value of calculated script in html form in RTC 3.0.1.3?
Hello,
I would like to display the link in RTC. The link address should be calculated based for every link. I have created following script:
(function() {
dojo.declare("com.example.ValueProvider", null, {
getValue: function(attribute, workItem, configuration) {
var value = workItem.getValue("id");
return "<a href=\"http:\/\/localhost:8080\/test?id=" + value + "\">Update CMT<\/a>";
}
});
})();
The value returned by the link is correct but I do not have any idea how to dispaly this link in web ui. If I am setting field to medium html format, the value is encoded. In other words I see entire string:
<a href="http://localhost:8080/test?id=10">Update CMT</a>
instead of "Update CMT" text which is link to http://localhost:8080/test?id=10
Any ideas?
I would like to display the link in RTC. The link address should be calculated based for every link. I have created following script:
(function() {
dojo.declare("com.example.ValueProvider", null, {
getValue: function(attribute, workItem, configuration) {
var value = workItem.getValue("id");
return "<a href=\"http:\/\/localhost:8080\/test?id=" + value + "\">Update CMT<\/a>";
}
});
})();
The value returned by the link is correct but I do not have any idea how to dispaly this link in web ui. If I am setting field to medium html format, the value is encoded. In other words I see entire string:
<a href="http://localhost:8080/test?id=10">Update CMT</a>
instead of "Update CMT" text which is link to http://localhost:8080/test?id=10
Any ideas?
8 answers
Hi Ralph,
Here is what is see in web ui:
{{https://jazz.net|Jazz.net}}
What is the kind of field and presentation you used for that? May it be issue with different presentation type?
Here is what is see in web ui:
{{https://jazz.net|Jazz.net}}
What is the kind of field and presentation you used for that? May it be issue with different presentation type?
Have you tried to enter some link you wanted into such an attribute and read the content, to spy at it?
This worked for me (only a link)
This worked for me (only a link)
/******************************************************************************* * Licensed Materials - Property of IBM * (c) Copyright IBM Corporation 2011. All Rights Reserved. * * TotalCostScriptedCalculatedValue * * Note to U.S. Government Users Restricted Rights: * Use, duplication or disclosure restricted by GSA ADP Schedule * Contract with IBM Corp. * ******************************************************************************/ dojo.provide("com.example.ScriptedDefaultValueProvider"); dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");
/** * @see https://jazz.net/wiki/bin/view/Main/AttributeCustomization#Using_scripts_for_attribute_cust
* @see https://jazz.net/wiki/bin/view/Main/AttributeCustomization#API_Example
*/
(function() {
var doDebug = true; dojo.declare("com.example.ScriptedDefaultValueProvider", null, {
getValue: function(attribute, workItem, configuration) { console.log("TotalCostScriptedCalculatedValue - Start"); var workFlowState = workItem.getValue("com.example.attribute.wiki"); console.log("WorkflowState: " + workFlowState);
return "{{httpas://jazz.net|Jazz.net}}";
} }); })();