Specify a date range with REST API? Proper date format?
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
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
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
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