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? |
8 answers
Ralph Schoon (63.7k●3●36●48)
| answered Sep 27 '12, 11:02 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Hi, you could try to use a Wiki type attribute.
|
Hi Ralph,
I wa s trying with following properties: return "[[http:\/\/localhost:8080\/test?id=" + value + "]]"; or return "[http:\/\/localhost:8080\/test?id=" + value + "]"; But in both cases I saw entire string (with [ and ] brackets). Any other ideas? |
Ralph Schoon (63.7k●3●36●48)
| answered Sep 28 '12, 8:35 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
I had an example where I used to return "{{someURL|sometext}}". Can you try that?
|
Hi Ralph. Ufortunately the results is the same :( I tried with on bracket and two brackets. Any other ideas?
|
Ralph Schoon (63.7k●3●36●48)
| answered Oct 01 '12, 8:23 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER edited Oct 01 '12, 8:25 a.m.
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)
/******************************************************************************* * 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");
|
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? Comments As I mentioned above, I used a Wiki type attribute with the Wiki Presentation. I am on 4.0 but I did a similar thing with 3.x, so I don't think that makes a difference.
|
Ralph, could you provide your process template for 3.x if you have such one?
|
You need to define the attribute as type Wiki. Only then it will be shown in the way you expected it.
|
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.