Work Item customizations using scripts in RTC 4.0.6
I'm trying to set default owner based on the few other Custom attributes using js script customization. I want to use attribute Value provider to get the owner id.
1. Where I need to put my Value provider tag in the process configuration file?
<valueSetProviders>
<valueSetProvider>
</valueSetProvider>
...
</valueSetProviders>
2. In my case can I add the script to Owner field directly or I need to create a custom field just for this script?
1. Where I need to put my Value provider tag in the process configuration file?
<valueSetProviders>
<valueSetProvider>
</valueSetProvider>
...
</valueSetProviders>
2. In my case can I add the script to Owner field directly or I need to create a custom field just for this script?
Accepted answer
Also see https://jazz.net/library/article/1093 lab 5 for how that works.
Some remarks:
You can only set attributes of tape Contributor/User by setting the UUID of the user. You can not search for users and get their UUID in JavaScript. You can also not search for roles. Carefully readd https://jazz.net/wiki/bin/view/Main/AttributeCustomization and https://jazz.net/library/article/1093 lab 5, the first two sections to understand what you can and can't do.
There are some default value providers available. See https://jazz.net/library/article/1093 lab 4.
There is very few information available that would allow a default value script to work. When the work item is created, there is almost nothing set, so you can't use a lot to work with. Only attributes with default value providers and the type attribute have any value.
So for the default, you can pretty much only use a single default user - which you can achieve with the available provider.
Some remarks:
You can only set attributes of tape Contributor/User by setting the UUID of the user. You can not search for users and get their UUID in JavaScript. You can also not search for roles. Carefully readd https://jazz.net/wiki/bin/view/Main/AttributeCustomization and https://jazz.net/library/article/1093 lab 5, the first two sections to understand what you can and can't do.
There are some default value providers available. See https://jazz.net/library/article/1093 lab 4.
There is very few information available that would allow a default value script to work. When the work item is created, there is almost nothing set, so you can't use a lot to work with. Only attributes with default value providers and the type attribute have any value.
So for the default, you can pretty much only use a single default user - which you can achieve with the available provider.
Comments
Donald Nong
Oct 06 '14, 8:35 p.m.I suggest you go through these articles first.
https://jazz.net/library/article/1003
https://jazz.net/wiki/bin/view/Main/AttributeCustomization
https://jazz.net/library/article/1360