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
|
Accepted answer
Ralph Schoon (63.5k●3●36●46)
| answered Jul 22 '13, 11:07 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
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
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
Ralph Schoon
commented Jul 22 '13, 12:22 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
As described in the workshop JavaScript does not provide an API to do what you want.
|
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.