Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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?

0 votes



19 answers

Permanent link
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

0 votes


Permanent link
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.

0 votes


Permanent link
How Can I convert UUID into the human readable value in javascript in RTC(3.0.1)?please help me!Thank you !

0 votes


Permanent link
sorry, missed the 'javascript' requirement.. haven't done any web UI extensions..

Sam

0 votes


Permanent link
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

0 votes


Permanent link
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

0 votes


Permanent link
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 &quot;workItem.getValue(WorkItemAttributes.FILED_AGAINST)&quot;. 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

0 votes


Permanent link
workitem.getCategory();
then lookup the handle to get the human readable value

Sam

0 votes


Permanent link
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?

0 votes


Permanent link
Thanks for posting. I had no time to try....

0 votes

1–15 items
page 1of 1 pagesof 2 pages

Your answer

Register or log in to post 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 11,085

Question asked: Nov 07 '11, 7:04 a.m.

Question was seen: 22,474 times

Last updated: Jun 28 '12, 4:29 p.m.

Confirmation Cancel Confirm