Auto Calculate Field Input Values
Accepted answer
One other answer
Thank you, Ralph. I created one script and it is working fine.
Now, my another requirement is the to update the new field F5 based on result F4.
F5 field is a enumeration based, low, medium and High.
Whatever value we get in F4, it should automatically map the corresponding value in F5.
Is it possible?
Another way is to mandate the field in work flow but again its a manual process.
Can you please help.
Here is the script what I have created
dojo.provide("com.example.f4");
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");
(function() {
dojo.declare("com.example.costToDate", null, {
getValue: function(attribute, workItem, configuration) {
try {
var rate = parseFloat(workItem.getValue("defect.f1"));
var hours = parseFloat(workItem.getValue("defect.f2"));
var resource = parseFloat(workItem.getValue("defect.f3"));
var f4;
f4 = f1 * f2 * f3
return cost.toString();
}
catch(err) {
var txt;
txt="There was an error on this page.\n\n";
txt+="Error description: " + err.message + "\n\n";
txt+="Click OK to continue.\n\n";
alert(txt);
}
}
});
})();
Comments
Read the Enactment Workshop Lab 3 and 4 at least, and https://jazz.net/wiki/bin/view/Main/AttributeCustomization . Yes, calculated values work for enumerations as well. Watch https://rsjazz.wordpress.com/2016/07/15/rtc-process-customization-what-you-can-and-cannot-do/ and be aware about the limitations.
Be careful what you try to implement and question the requirements.
Next time please ask another question, instead of answering a question to an accepted answer.