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

Get non built-in attribute values from javascript

How to get Custom Attribute values from Javascript?

In the https://jazz.net/wiki/bin/view/Main/AttributeCustomization#API_Example wiki there is the list of the constants that can be used to get Workitem built-in attributes.

In https://jazz.net/wiki/bin/view/Main/AttributeCustomizationExamples#Get_an_item_s_UUID_users_iterati is shown how to create a custom attribute to store - for instance - UserName. The value of the custom attribute is automatically calculated by the attribute OwnenBy (of the workitem) and can be "Use(d) this id in other scripts that need to identify this particular user"

How to get the value of this new (custom) attribute from other scripts?

Thanks in advance,
Marco Delato

0 votes



One answer

Permanent link
When you create the custom attribute, take note of the ID value you assign it and use that in the workItem.getValue() call (rather than use one of the built-in IDs defined in WorkItemAttributes.*).

For example, I created a custom attribute named customAttribute1 (a small string) and set its ID value to "edu.millard.customattribute1". To retrieve it in JavaScript, I just used: var customAttr1 = workItem.getValue("edu.millard.customattribute1");

0 votes

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
× 478
× 369

Question asked: Jul 10 '12, 12:24 p.m.

Question was seen: 5,061 times

Last updated: Jul 10 '12, 3:53 p.m.

Confirmation Cancel Confirm