WI attribute customization: get custom attribute value
![]()
In work item customization getting the value of a built in attribute is straight forward i.e. com.ibm.team.workitem.api.common.WorkItemAttributes class which contains the the string constants that are used to access built-in attributes of work items such as SEVERITY, PRIORITY etc.
Is there any other class which you can use to get the values of custom attributes? |
19 answers
![]() Thanks for posting. I had no time to try.... No problem! It returns a UUID rather than a String though, how do I convert it? |
![]()
workitem.getCategory();
then lookup the handle to get the human readable value Sam |
![]() workitem.getCategory(); workitem.getCategory() did not work I'm afraid and I'm still having trouble converting the UUID I get from "workItem.getValue(WorkItemAttributes.FILED_AGAINST)". As far as I'm aware, this should not return a UUID? Even calling 'toString()' on it returns the same value, namely, '_O7KQEvZmEeC94ecF979KKA' Any solution to help me with my confusion here would be most appreciated. Thanks, Henry |
![]()
workitem.getCategory();
returns a HANDLE to a CATEGORY.. you need to use something like resolveAuditable() to convert that handle to the appropriate iCategory object, and then retrieve the string value via getName() Sam |
![]() workitem.getCategory(); Hi Sam, As I have said already, workitem.getCategory() does not work, in fact it does not even compile. Please see the Attribute Customization and the Javascript API here: https://jazz.net/wiki/bin/view/Main/AttributeCustomization#API_for_Javascript I will try resolveAuditable() and getName() though, thank you. Henry |
![]()
sorry, missed the 'javascript' requirement.. haven't done any web UI extensions..
Sam |
![]()
How Can I convert UUID into the human readable value in javascript in RTC(3.0.1)?please help me!Thank you !
|
![]() How Can I convert UUID into the human readable value in javascript in RTC(3.0.1)?please help me!Thank you ! I never found out how to do it, I don't think it's possible I'm afraid. |
![]()
Hi Russell,
Above you say: After some experimentation I got it to work by passing the custom
attribute as a parameter in the process configuration source (xml) e.g.:
<valueProvider> <script> <parameters> You can accesss this in the javascript e.g.: getValue: function(attributeId, workItem, configuration) { var type_id = configuration.getChild("parameters").getStringDefault("typeAttribute", ""); return workItem.getValue(type_id); I am also trying to access a custom attribute of type Integer from JavaScript to perform some calculations and return the value of a different attribute. In the process configuration source, under the <parameters> node, how should I list my params and their values?? My custom attribute has an id of "chargeRate". Thanks very much in advance, Murad |
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.