It's all about the answers!

Ask a question

Specify a date range with REST API? Proper date format?


Mike Shkolnik (9809161143) | asked Nov 05 '14, 1:59 p.m.
edited Nov 05 '14, 4:02 p.m.
I need to return work items created and modified between a specific date range via the REST API. It looks like I can use < and > to specify a range, but any date syntax I try returns an invalid date error. My REST API string is as follows:

https://SERVER:PORT/jazz/rpt/repository/workitem?fields=workitem/workItem[type/id="task" and creationDate>DATESPECNEEDED]/*

Sample Errors:
CRRED0106E: Invalid date value: 2014-10-12
CRRED0106E: Invalid date value: 2014-10-12T18:16:59.831
CRRED0106E: Invalid date value: 2014-10-12T18:16:59.831 0000

I have tried ISO 8601, Julian, epoch, and various combinations of month day and year, with and without time, and with and without quotes. Any idea what format it needs?


Accepted answer


permanent link
Alan Sampson (93749) | answered Nov 05 '14, 7:54 p.m.
JAZZ DEVELOPER
After some experimentation I got the following to work:
https://server:port/ccm/rpt/repository/workitem?fields=workitem/workItem[type/id="task" and creationDate>2012-12-17T09:30:16.427-0500]/(id|summary|creationDate)

It would appear that the time zone needs to be abutted to the rest of the date with a +/- (you may need to substitute %2b for + to get the parser to accept positive time zone adjustments)

See also https://jazz.net/wiki/bin/view/Main/ReportsRESTAPI#Examples
Mike Shkolnik selected this answer as the correct answer

Comments
Mike Shkolnik commented Nov 05 '14, 8:29 p.m.

You are correct! changing the "+" to "-" did the trick. Thanks much.

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.