It's all about the answers!

Ask a question

Caculated value script (date)


VK L (8177157159) | asked Feb 19 '13, 10:09 a.m.
 Hi All, 
           I am trying to create a calculated value script for this: 

newdate = duedate + 7 days 

I am getting this error: 
[ ccm: AsynchronousTaskRunner-1] ERROR com.ibm.team.workitem.common                        - Error invoking value provider 'com.ibm.team.workitem.valueproviders.VALUE_PROVIDER._AzZLYHmpEeK5jqU0rlGqKg' 
com.ibm.team.repository.common.TeamRepositoryException: Unexpected exception type 
org.mozilla.javascript.EcmaError: TypeError: Cannot call method "getFullYear" of null ({"Bundle-SymbolicName":"org.dojotoolkit.dojo", "path":"\\resources\\date", "name":"stamp.js"}#127) 

My script is as below: 
(function() { 
var WorkItemAttributes= com.ibm.team.workitem.api.common.WorkItemAttributes; 
    dojo.declare("com.ibm.workitems.providers.Date", null, { 

        getValue: function(attributeId, workItem, configuration) {                
        console.log("Start.."); 
        var dueDate = dojo.date.stamp.toISOString(workItem.getValue(WorkItemAttributes.DUE_DATE));        
        var date1= dojo.date.add(dueDate, "day", 7); 
        console.log("Now is: " + date1); 

    return date1;        

        } 

    }); 

})(); 

Please advise. 

Thanks. 

One answer



permanent link
Ralph Schoon (63.5k33646) | answered Feb 19 '13, 2:31 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
 Please see my answer on your similar https://jazz.net/forum/questions/103161/custom-date-attribute-based-on-due-date-value please note, you can add try and catch around statements to narrow down where it happens and why.

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.