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

Default Value JS : set the category with the label

 Hello,

I would like create a JavaScript Default Value to set the category according the TYPE of workitem.
 How can i set the field "Filed Against" without return the UUID but returning the label of the category ?

Thanks,

Antoine

0 votes


Accepted answer

Permanent link
Please consider reading https://jazz.net/library/article/1093 Lab 5 (and lab 4 is also interesting).

To set filed against, you have to return the UUID. There is no way around it. If you want to set it in JavaScript you have to, because you have very few API and nothing that helps you to iterate the existing Categories, store the UUID to return in the process configuration.

You could follow http://rsjazz.wordpress.com/2013/06/26/attribute-customization-java-based-value-providers-conditions-and-validators/ and create a a default value provider. This gives you more access, includiung, I believe, access to all the categories as Objects, where you can look up the label and return the UUID for the one you want to pick.

Antoine LELEU selected this answer as the correct answer

0 votes

Comments

 

Thanks you Ralph,

This is my problem :

I share the process configuration with several projects where the UUID of categories are differents. So i can't store the UUID in my script.

I searched a way to retun label of categories cause it is the same in all projects. Or find the UUID according the label directly in the JS.

Antoine  

As described in the workshop JavaScript does not provide an API to do what you want.
You can not iterate the existing categories, you can not search them. You ONLY have access to the work item's attributes and their values.

So JavaScript will not be able to help you with solving your problem. If you need what you describe you need to follow http://rsjazz.wordpress.com/2013/06/26/attribute-customization-java-based-value-providers-conditions-and-validators/ and use Java, becaue that has the API's you need. 

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
× 10,941

Question asked: Jul 22 '13, 10:17 a.m.

Question was seen: 4,301 times

Last updated: Jul 22 '13, 12:22 p.m.

Confirmation Cancel Confirm