It's all about the answers!

Ask a question

Issue with script based calculated value in RTC

Anatoliy Khludov (32613) | asked Nov 29 '12, 3:11 p.m.
edited Apr 02 '13, 4:45 a.m. by Ralph Schoon (63.2k33646)

I have created three new attributes of type "Duration" --  "QA Estimate", "Dev Estimate" and "Total Estimate". The "Total Estimate" attribute uses calculated value from the script TimeEstCalc.js and has dependencies on "QA Estimate" and "Dev Estimate" attributes.

Here is the TimeEstCalc.js script:



(function() {

    dojo.declare("com.example.common.TimeEstCalc", null, {


        getValue: function(attribute, workItem, configuration) {


                                             return workItem.getValue("devEstimate") + workItem.getValue("qaEstimate");





After I enter values into "QA Estimate" and "Dev Estimate" fields in the newly created work item, and trying to save the work item, I get the error:

The value of attribute 'Total Estimate' is not valid. Enter a valid duration (w = weeks, d = days, h = hours, m = minutes).

So looks like the "Total Estimate" attribute expects values to be entered instead of returning the calculated value based on the script.

I have script execution enabled in

Not sure what I am doing wrong.


Accepted answer

permanent link
Brian Fleming (1.6k11928) | answered Nov 29 '12, 9:05 p.m.
This works for me (on  I assume you are using the "Time Duration" Presentation Kind.  Do you see anything happen in the Total Estimate attribute when a value is entered in devEstimate or qaEstimate?  If not, double check the ids of the attributes you created are "devEstimate" and "qaEstimate" (case sensitive).  If they are not, change your script to exactly match the ids.  Also double check that the dependencies on these two attributes are set for the "Total Estimate" attribute.  If still no luck, screen shots of the "Edit Custom Attribute" and "Edit Presentation" dialogs might help.
Anatoliy Khludov selected this answer as the correct answer

One other answer

permanent link
Anatoliy Khludov (32613) | answered Nov 30 '12, 12:27 p.m.
Hi Brian, I was using "Time Estimate" Presentation Kind in "Edit Presentation" section. After changing it to "Time Duration" for all three attributes, everything worked as expected! The "Total Estimate" value gets calculated immediately after I enter values into the "Dev Estimate" and " QA Estimate" fields. Thank you so much for your help !

Your answer

Register or 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.