How to set Due date automatically using java API
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?
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?
Accepted answer
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?
Comments
Gowra chandra varma
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});