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

Caculated value script (date)

 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. 

0 votes



One answer

Permanent link
 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.

0 votes

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
× 6,131

Question asked: Feb 19 '13, 10:09 a.m.

Question was seen: 4,651 times

Last updated: Feb 19 '13, 2:31 p.m.

Confirmation Cancel Confirm