Help with Script Create - Set the Value for Enumerations
![](http://jazz.net/_images/myphoto/110ee3f07b99ddc5a77ecadac1af8978.jpg)
- Milestone1 Enumeration to "1 Initial"
- Milestone2 Enumeration to "2 Study"
One answer
![](http://jazz.net/_images/myphoto/110ee3f07b99ddc5a77ecadac1af8978.jpg)
Comments
![](http://jazz.net/_images/myphoto/110ee3f07b99ddc5a77ecadac1af8978.jpg)
Hi is it not possible to have one script that defines all Variables:
![](http://jazz.net/_images/myphoto/e5e63d5878217b64611c1df9401b7cd3.jpg)
A value provider can only provide the value to one attribute. You can use the same provider for several ones if the type matches.
Here is example code - consider to read the workshop.
/*********** * Licensed Materials - Property of IBM * (c) Copyright IBM Corporation 2011. All Rights Reserved. * * Note to U.S. Government Users Restricted Rights:
* Use, duplication or disclosure restricted by GSA ADP Schedule * Contract with IBM Corp. ***********/ dojo.provide("com.ibm.js.rtc.wi.provider.default.Skeleton");(function() { dojo.declare("com.ibm.js.rtc.wi.provider.default.Skeleton", null, {
getDefaultValue: function(attribute, workItem, configuration) { //var value = //... //Some code that computes a return value //return value; return "priority.literal.l3" // Medium priority }
}); })();
![](http://jazz.net/_images/myphoto/110ee3f07b99ddc5a77ecadac1af8978.jpg)
I've found this script as I'm new and do not understand scripting: how can this be expanded for all mappings?
dojo.provide("com.example.DefaultValueProvider");(function() { dojo.declare("com.example.DefaultValueProvider", null, {
getDefaultValue: function(attribute, workItem, configuration) { return "Risk.literal.l3" } });
})();
![](http://jazz.net/_images/myphoto/e5e63d5878217b64611c1df9401b7cd3.jpg)
Start here: https://jazz.net/wiki/bin/view/Main/AttributeCustomization and https://jazz.net/library/article/1093 lab 5
You can only deal with one enumeration at a time.
If you use the same enumeration for all attributes, you could use the attribute ID 'attribute' from the call.
e.g. if(attribute="id.of.attrib1") ....
![](http://jazz.net/_images/myphoto/110ee3f07b99ddc5a77ecadac1af8978.jpg)
Hi,
![](http://jazz.net/_images/myphoto/e5e63d5878217b64611c1df9401b7cd3.jpg)
If you would just care to look at the workshop and the other link I proposed you to read, all your questions would be answered, I think.