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

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?

0 votes

Comments

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
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

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
× 10,941

Question asked: Jul 25 '11, 5:11 a.m.

Question was seen: 6,054 times

Last updated: Jul 19 '12, 4:58 a.m.

Confirmation Cancel Confirm