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?
Is there any other class which you can use to get the values of custom attributes?
19 answers
Hi Russell,
Above you say:
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
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);
<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
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
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
workitem.getCategory();
then lookup the handle to get the human readable value
Sam
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
page 1of 1 pagesof 2 pages