It's all about the answers!

Ask a question

How to set Due date automatically using java API


Roger Layani (5313238) | asked Jul 25 '11, 5:11 a.m.
I am trying to set the due date depending on severity field value:

Using the java API in a javascript I get the error message
!MESSAGE Error invoking value provider 'com.ibm.team.workitem.valueproviders.VALUE_PROVIDER._wCYtsLY-EeCDCcPhpmWolw'
!STACK 0
java.lang.NumberFormatException: For input string: "2011-08-01T09:00:46.909Z"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:63)
at java.lang.Long.parseLong(Long.java:427)
at java.lang.Long.parseLong(Long.java:476)
.........
I am using script line
var DueDate=dojo.date.stamp.toISOString(myDate, {milliseconds:true, zulu:true});

what is wrong?

Comments
Gowra chandra varma commented Jul 19 '12, 4:58 a.m.

Hi roger,

I am using below script to print current date. Can u pls share the script to edit the date format.

i.e. I have to print 15th as date with current month & year.

var now = new Date(); var date= dojo.date.stamp.toISOString(now, {milliseconds:true, zulu:true});

Accepted answer


permanent link
Aaron LaBella (5143) | answered Aug 06 '11, 7:57 p.m.
Looks like its expecting the date in just its long format, ie: milliseconds. Try sending in the long value.

I am trying to set the due date depending on severity field value:

Using the java API in a javascript I get the error message
!MESSAGE Error invoking value provider 'com.ibm.team.workitem.valueproviders.VALUE_PROVIDER._wCYtsLY-EeCDCcPhpmWolw'
!STACK 0
java.lang.NumberFormatException: For input string: "2011-08-01T09:00:46.909Z"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:63)
at java.lang.Long.parseLong(Long.java:427)
at java.lang.Long.parseLong(Long.java:476)
.........
I am using script line
var DueDate=dojo.date.stamp.toISOString(myDate, {milliseconds:true, zulu:true});

what is wrong?
Ralph Schoon selected this answer as the correct answer

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.