RQM API - querying for records updated in a given range
What if I only want to return artifacts from a given date range? Something like, return all recirds updated between 2014-08-01T00:00:00 and 2014-09-01T00:00:00?
The modifiedSince function says to consider using fields instead, and this implies that the functionality I want is possible. But unfortunately, the greater than and less than operators don't appear to work with a filter on updated.
This works:
executionresult?fields=/feed/entry/content/executionresult[updated='2014-08-03T00:27:24.612Z']
This does not:
executionresult?fields=/feed/entry/content/executionresult[updated>='2014-08-03T00:27:24.612Z']
(it returns all results)
Here's the documentation for modifiedSince. Am I missing something? Why would I use fields filtering if I had to know the milliseconds I was looking for?
modifiedSince
<feedUrl> only.
Value | Meaning |
<XML dateTime> | Resources modified after (or greater than) the date time. |
In addition, see note 15 on the
labresource
resource.
As an alternative, use fields filtering.
Accepted answer
You could use a field filter like:
?fields=feed/entry/content/executionresult[updated>=
'2014-08-03T00:00:00.000Z' and
updated<=
'2014-08-04T00
:00:00.000
Z']
]/*
For more information, see https://jazz.net/wiki/bin/view/Main/RqmApi#fields.
If the inequality operators are not working, please open a RQM defect.
Comments
Hey Paul,
Thank you for your response. I wasn't trying to use the "and" operator. I knew to do that, but didn't state so specifically. What I was trying to show was that the inequality operators don't appear to work, so of course, an and operation using them won't work.
I was hoping I was just missing something. I guess I'll open a defect.
Kevin
Get this -- I messed with Paul's suggestion while entering the defect (but before submitting it) and it worked! I am not sure what was not working yesterday.
This got me what I wanted:
/executionresult?fields=feed/entry/content/executionresult[updated>='2014-08-01T00:00:00.000Z' and updated<'2014-08-31T00:00:00.000Z']/*
I'm not sure why this wasn't working yesterday but I hope this helps someone else!
Kevin, the only difference appears to be < versus <= operators. Can you try the <= operator?