How to return unchanged SUMMARY in a calculated script?
![]() Hello,
return workItem.getValue(WorkItemAttributes.SUMMARY);So this implies, the Summary should not be changed, because the actual value is returned. But in fact, there is happening an encoding when I save the work item. For example Summary: "New Title with double space"So i tried to do: var html= workItem.getValue(WorkItemAttributes.SUMMARY);Then I tried to do: throw "Known trap";The good thing, SUMMARY is not changed at all, what I wanted to reach. But it throws an exception either "document" not known or with my throw message "Know trap". Both fills my logs. So this does also not help. My primary question is: - How can I return the SUMMARY without any change out of a calculated script, without throw an exception? - If only possible with a throw, how can I throw just an Info or something I can filter out in log4j.properties? Btw. I read the article, calculated scripts are for text fields. But somebody at IBM had the idea to have Summary as mediumHTML, built in and calculated scrips are executed on all Work Item types for built in attributes. So it does not help me, to tell me this is not supported. I need a solution. And it must be in JavaScripts in WerbUI, because I have dependency fields, so it is not executed server side as much as I know. regards Guido |
One answer
![]()
Ralph Schoon (62.0k●3●36●43)
| answered Oct 27 '17, 6:15 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Guido, I have no answer for you here. I am not able to avoid the encoding of the HTML in JavaScript either.
I think that the JavaScript API basically uses createFromPlainText() on the data you pass and that you are therefore doomed. If you want to be really sure, you would have to raise a PMR. In the JavaAPI you can control this a lot better. https://rsjazz.wordpress.com/2013/06/26/attribute-customization-java-based-value-providers-conditions-and-validators/ shows how you can use Java instead of JavaScript. You could try to use the correct encoding method and pass the value back. |