Help with Script Create - Set the Value for Enumerations

- Milestone1 Enumeration to "1 Initial"
- Milestone2 Enumeration to "2 Study"
One answer

Comments

Hi is it not possible to have one script that defines all Variables:

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 }
}); })();

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" } });
})();

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") ....

Hi,

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.