calculated value of 3 enum values in RTC work item
almsupport alm (13●19)
| asked Jan 07 '20, 4:11 a.m.
edited Jan 07 '20, 4:58 a.m. by Ralph Schoon (63.5k●3●36●46) We want to have calculate(multiply of 3 valiues) value for 3 different enumerated attributes. I came to know that it should be javascript. please let me know how the javascriptshould be. how it should be tested .
We created enum attribute serverity like 1 to 10 , second one is Occurance enum attribute 1 to 10 values and also Detection enum attribute 1 to 10 and also we have RPN Integer attribute in this we want multiplication of above 3 enum values and store it in RPN attribute.
Please support.
Regards,
ALM
|
3 answers
Hi ALM,
Firstly you need to ensure that CCM / RTC Scripts are enabled. (ref question answered before)
Then take a look at this example for calculated fields in work item to see if you can TEST a calculated script in a Dev environment.
1. I would test it's use in Web and Eclipse and then look in the Error logging (eclipse) to ensure you script is good.
2. Check the RTC logs to ensure nothing is output or any errors - not essential.
I hope that helps
Matt Muller
|
Related: Enumerations have 2 'parts' in the process config. One is the ID which is stored in the RTC database, the 2nd is the display value. One specific enumeration predefined for Scrum ( complexity ) has ID equal to the display value. You will want to verify that the fetch of the attribute value represents a numeric value.
Here's that complexity enumeration from a pretty basic Scrum configured project.
<enumeration attributeTypeId="complexity" name="complexity"> If one adds a new value to this enumeration its 'id' will be something like complexity.literal.l7 and it will throw off some of RTC's calculations. I'm sure that the same feature will impact what OP is intending. |
HI,
We tried for two enum attribute values multiplication but this code is not working for us.
Please review the code and suggest the right code.
dojo.provide("com.example.rpnrate");
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes"); (function() { dojo.declare("com.example.rpnrate", null, { getLabel: function(attribute, workItem, configuration) { try { var Detection = parseString(workItem.getLabel("detection")); var Probability = parseString(workItem.getLabel("Probability_Occurrence")); var detect; detect = Detection * Probability return rpn.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); } } }); })();
Thanks !!
|
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.