Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Auto Calculate Field Input Values

Hi,


I have three fields F1, F2 and F3 which has integer properties.
I want to auto calculate fourth field F4 based on the values from these three fields F1 +F2+F3.
Can someone please share me the script.

Thank you

0 votes


Accepted answer

Permanent link

 https://jazz.net/library/article/1093 last lab

R Z selected this answer as the correct answer

0 votes


One other answer

Permanent link

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

0 votes

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.

Your answer

Register or log in to post 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,926

Question asked: Aug 20 '19, 8:23 a.m.

Question was seen: 1,805 times

Last updated: Aug 21 '19, 7:42 a.m.

Confirmation Cancel Confirm