It's all about the answers!

Ask a question

Caculated value script (date)


VK L (8177151159) | 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 (62.3k33643) | 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.